Тёмный
Stephen O'Neill
Stephen O'Neill
Stephen O'Neill
Подписаться
Creating videos to help everyone better understand programming concepts.

Let me know what you want to see.
Комментарии
@bonzpi
@bonzpi 7 дней назад
absolutely beautiful. No other video actually spends time on the call stack!
@iFrostGraal
@iFrostGraal 10 месяцев назад
Hi Stephen, loved the video! I would be very interested to learn how to implement memory into the chatbot if you'd be able to break this down :)
@Richard-yz2gy
@Richard-yz2gy Год назад
Hi Stephen, if "3.left" is None=0 from the right side of the tree then how can you put left= 3 in the final return statement surely it should be 0 because the last value for the varaible for "left" is 0 not 3 surely?
@frazebean5117
@frazebean5117 Год назад
Thank you mate I love your video.
@xyzoooo401
@xyzoooo401 Год назад
Hi how is this linked to a stack ? Is stack only used for visualisation ? TIA The pseudo code seems much more straightforward. dfs(n, visited): print(n.value) for a in n.adjNodes { if !visited.contains(a) { dfs(n, visited) } }
@rathan235
@rathan235 Год назад
Great job
@pettymanny6487
@pettymanny6487 Год назад
To be true Only because of this video I understood how to solve this problem!
@ejsafara456
@ejsafara456 Год назад
god bless ya!
@sononsoft5253
@sononsoft5253 Год назад
One of the best explanation out there!
@BagsyBag
@BagsyBag Год назад
I was confused about why the second while-loop only dealt with the elements in the left sub-array and not the elements in the right sub-array. The way I understand it is: - The second while-loop is needed in case "helper position-j" reached the end of the right sub-array in the first while-loop. - Another while-loop is not needed if "helper position-i" reached the end of the left sub-array in the first while-loop because: 1. The right sub-array's remaining elements are guaranteed to be of higher value than the elements in the sorted portion of "numbers-array". 2. Each of the two sub-arrays is by itself already sorted. - This means that the right sub-array's remaining elements are all of higher value AND already sorted. - The remaining elements in "numbers-array" are the same as in "helper-array" since that is just a copy, so we are done. Maybe it's just me that got confused about that but there you go. I think that's how it works...
@siriuz9279
@siriuz9279 Год назад
well explained
@tahakhan3963
@tahakhan3963 Год назад
thanks a lot for the explanation
@lappham6915
@lappham6915 Год назад
Clear!!
@jacob.lee380
@jacob.lee380 2 года назад
I've been watching more than 10 videos to understand how binary tree traversal and recursion work. This is the first video I truly understand both concepts! Thanks!
@rocknikhil5905
@rocknikhil5905 2 года назад
Recursion part in merge sort always confused me and no other video explained the flow. Thanks to you now I finally understand it.
@echoness_
@echoness_ 2 года назад
I just a bit confused how you discovered the combination formula. I guess this is the hardest part for solving the problem.
@spiritualgyanhindi2681
@spiritualgyanhindi2681 2 года назад
Really i got it this time! Finally at here...
@menoima9501
@menoima9501 2 года назад
omg bless you lad
@bennet5467
@bennet5467 2 года назад
Excellent explanation. Thanks sir!
@mikkoylimannila8104
@mikkoylimannila8104 2 года назад
Thanks, this helped me in my computer science class!
@DeepakYadav-jc8mo
@DeepakYadav-jc8mo 2 года назад
intuitive explanation!
@Mobilizes
@Mobilizes 2 года назад
this video helped me immensely, i was getting incredibly frustrated on learning dynamic programming because it looked really complicated. this video is simple and thats just what i need to understand! thank you
@MrZH6
@MrZH6 2 года назад
Awesome! Thanks, really helpful.
@moamenzakaria4771
@moamenzakaria4771 2 года назад
Sounds like it can't be simplified more, but I still feel too stupid to get it :\
@tinyu1804
@tinyu1804 2 года назад
nice explanation ! thx you soooo much for my mid exam
@siomarapantarotto
@siomarapantarotto 2 года назад
What a great explanation! Congrats and thanks for sharing this content.
@vishwanathchintala2000
@vishwanathchintala2000 2 года назад
man you arraymazing
@salmonmonkey24
@salmonmonkey24 2 года назад
Excellent explanation of the inner workings of merge sort! Just what I was looking for. Thank you!
@TonyDiCroce
@TonyDiCroce 2 года назад
Ok so instead of the recursive state of a stack frame representing a sub problem we use an array. This is clearly more flexible than recursion because it's trivial for the computation of a sate to reference arbitrary other states without those values having to be threaded through function arguments and returns.
@shirishherwade6680
@shirishherwade6680 2 года назад
If you are searching/liking this video means you came here for recursion and not for merge sort. As you already understood the algorithm but bit confused about how recursion calling happening.
@rishabhchauhan6016
@rishabhchauhan6016 2 года назад
helped a fuck out of me !!
@Gman-kx9dr
@Gman-kx9dr 2 года назад
the cleanest explanation I can find on youtube...especially about the recursion which trips me up all the time... a bunch thanks man ...
@user-sw1wq8lh2w
@user-sw1wq8lh2w 2 года назад
wow, so good.
@ratmouse088
@ratmouse088 2 года назад
great video
@gergerger53
@gergerger53 2 года назад
3:40 - "The amount 2 is greater than 1, so we move on" - this sounds like you're saying it should be skipped, but you go on to use it. I don't think "move on" is the right phrasing for this part of the video (if the goal is to provide a clear and easy / unambiguous explanation of the problem).
@corymaklin7864
@corymaklin7864 2 года назад
You're amazing
@simiyutube
@simiyutube 2 года назад
i know this is rather old video but was most helpful after digging around for ages to find a straight forward explanation of the dynamic programming solution to this problem. Thanks Steve
@ne4rys
@ne4rys 2 года назад
clear, simple and short explanation. best tutorial
@rezwanislam1332
@rezwanislam1332 2 года назад
thank you so much for doing this in such a concise manner. I learned more from this short video than I did in a whole semester.
@bhaskargoud893
@bhaskargoud893 2 года назад
excellent explanation
@mohammedalkhateem
@mohammedalkhateem 2 года назад
This is a useless video, like I understood everything and you explained it clearly, but the video is basically saying here's a solution and this is why it works. How did we come up with that solution and what was the thought process? you're on your own. This is basically a video for someone who's trying to memorize as much leetcode problems as they can to prepare for an interview or whatever, not for someone trying to learn
@sanchitbhatnagar7283
@sanchitbhatnagar7283 2 года назад
Hey, can someone help me at 5:30, i wondering if the recursive mergesort divides until low<high, then how is it that have merging the first two individual elements, it will mergesort and then merge. ?
@udayptp
@udayptp 2 года назад
Which software you used to make this video, specially i liked your animation work
@lover1301
@lover1301 2 года назад
I got stuck with merge sort fews day and you helped me
@lellajagadeeswar596
@lellajagadeeswar596 2 года назад
thank u very much
@wadigzonDiazwong
@wadigzonDiazwong 3 года назад
Memorization is not the same as understanding, I came here to understand the problem, and this explanation falls short from that, I was not looking for a formula but for an approach that will work with other similar problems, though the video gives you the generic formula it doesn't explain its origin. one intuitive way to go about the formula is as follows: for our base case where amount = 0 and any number of coins, we only have one combination: no coins also, for any amount>0 and no coin, there are zero combinations say we have one coin [2], and one amount = 10 we can see that before we reach 10, we will reach 8 (10-2) and then 6 (8-2), and so on until we reach 0 (2-2) our table would look like this for amount 10 and coin [2] amount| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ------------------------------------------------------------------ coin=0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ------------------------------------------------------------------ coin=2 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ------------------------------------------------------------------ which makes sense, there's one way to do 10 with type 2 coins: 2+2+2+2+2 now say we add one more coin type (3) and our coin array becomes [2,3] we can reuse the existing table to compute the new number of combinations, we just add whatever was in that slot in the previous table so table[amount] = table[amout] + table[amount - coin] and we only care for when amount - coin >= 0 amount| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ------------------------------------------------------------------ coin=0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ------------------------------------------------------------------ coin=2 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ------------------------------------------------------------------ coin=3 | 1 | 0 | 1 | 1 | 1 | 1 | 2 | 1 | 2 | 2 | 2 | ------------------------------------------------------------------ we can add another coin (4), our new coin array becomes [2,3,4] amount| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ------------------------------------------------------------------ coin=0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ------------------------------------------------------------------ coin=2 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ------------------------------------------------------------------ coin=3 | 1 | 0 | 1 | 1 | 1 | 1 | 2 | 1 | 2 | 2 | 2 | ------------------------------------------------------------------ coin=4 | 1 | 0 | 1 | 1 | 2 | 1 | 3 | 2 | 4 | 3 | 5 | ------------------------------------------------------------------ So the total number of combinations to get 10 from coin [2,3,4] is 5 they are, 2+2+2+2+2, 2+3+2+3, 2+4+2+2, 2+4+4, 3+4+3, Here is the JavaScript solution: var change = function(amount, coins) { const table = new Array(amount+1).fill(0); // no coin is a combination // to get amount = 0 table[0] = 1; for (let coin of coins) { for (let i=0; i< table.length; i++) { if (i >= coin) { table[i] += table[i - coin]; } } } return table[amount]; };
@ellisarmeanca2223
@ellisarmeanca2223 3 года назад
thank you so much
@swayamprajapat6154
@swayamprajapat6154 3 года назад
totally stupid explanation , why TF would you make a video to dictate the CODE???
@SiddhantParkar
@SiddhantParkar 3 года назад
Thank you, this helped
@nottomention
@nottomention 3 года назад
Nice man! You've explained quite nicely.