Merge Sort 4 - Towards an Implementation (Recursive Function)

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 62

  • @n0wsky538
    @n0wsky538 9 місяців тому +1

    thank you very much sir, surfed the entire net for satisfaction but the high tide was here, thanks for the great surf-time got to love tides more with your vid.

  • @chrispy808
    @chrispy808 2 роки тому +1

    Genuinely the best explination of the merge sort recursive function I've found (and believe me I've been watching a lot of them). Really appreciate the thorough explanation with ca;ll stack visualisation

  • @anuabraham2524
    @anuabraham2524 5 років тому +15

    Man that was superb
    if only we had teachers like you
    the world can go next level quickly :)
    thanks for the video

  • @gothams1195
    @gothams1195 4 роки тому +9

    This is by far the most detailed video on MergeSort on the NET, a lot of other videos do not show the sequence , which is very important , Thanks a lot man .

    • @ComputerScienceLessons
      @ComputerScienceLessons  4 роки тому +3

      Glad you appreciate it. Merge sort is easy to understand at a high level, but being able to implement it requires a deeper understanding. Thanks for the comment. :)KD

  • @hossammohamed5794
    @hossammohamed5794 4 роки тому +4

    I kept looking for this for like 3 days. I could confidently say that you are the only resource that shows how the 2 recursive functions back to back work in the stack. Thank you

    • @ComputerScienceLessons
      @ComputerScienceLessons  4 роки тому +3

      It's definitely a concept that isn't usually explained very well. This should also help you to understand recursion and, when it comes to it, Big O time and space complexity. Thanks for the lovely comment. :)KD

  • @xianzhou8608
    @xianzhou8608 Рік тому

    Thank you! Finally found a video of how recursive merge sort works inside the computer. I was wrapping around my head trying to trace the recursion. And this video really helps.

  • @MathIsGreatFun
    @MathIsGreatFun 6 років тому +5

    Fantastic video, thank you! Using the call stack makes the recursive process so much more intuitive. Without this, the control flow makes little sense and it becomes about a lot of hand-waving. Very well done!

  • @jammy2003
    @jammy2003 Рік тому +1

    Thanks so much for this! I was looking for an explanation using the call stack to see the order in which the functions will get fired and this demo was superb!

  • @pinku11203211
    @pinku11203211 7 років тому +5

    Wonderful tutorial. Explanation is so descriptive and easy to understand. Couldn't find anything like this somewhere else. I became your fan Kevin.

  • @obinnaubah9045
    @obinnaubah9045 6 років тому

    This is the most well detailed and thoroughly explained version of Merge Sort I have come across.
    I had issues understanding the recursive calls but you have broken them down so easily and step by step that anyone could follow along.
    Thank you so much!
    You're the bomb!

  • @jerrylei2654
    @jerrylei2654 3 роки тому +1

    very well explained, the call stack even have the same color with the list that function is handling ,very detailed .Thank you !

  • @sunnyvarun6652
    @sunnyvarun6652 4 роки тому +2

    I was trying to understand how recursion works in Merge sort. Glad that I found this video, thanks a lot!!

  • @vandanachandola322
    @vandanachandola322 4 роки тому +2

    This is the best explanation out there! I implemented this in C# and debugged with the call stack. Each recursive call creates it's own set of local variables, and this makes so much more sense now. Thank you Kevin =)

  • @sanajaobathongram4110
    @sanajaobathongram4110 Рік тому +1

    Excellent video!! The recursion call stack visualization is superb!

  • @debasmitamallick8049
    @debasmitamallick8049 4 роки тому +2

    This is the best playlist for merge sort. Thank you so much for these wonderful explanations : )

  • @festus5447
    @festus5447 7 років тому

    This explanation is so clear, that halfway through the video I paused and wrote a working implementation in C#. Thank you! Best video on the subject so far.

  • @ozzy2361
    @ozzy2361 Рік тому +2

    Fantastic explanation! When I think of recursion problems, it's difficult for me to keep track of the stack. I find it necessary to draw notes and keep a copy of the stack

    • @ComputerScienceLessons
      @ComputerScienceLessons  Рік тому +1

      Recursion was a tricky concept for me when I first met it. Thinking about recursive code in terms of the execution stack definitely helped me. Some lucky people can just 'see' it. :)KD

  • @youraverageprogrammer7532
    @youraverageprogrammer7532 4 роки тому +1

    Wow, Great video! The use of the call stack to show control flow is what did it for me!

  • @thetempest2466
    @thetempest2466 Рік тому

    thank you so much for this video, best video on youtube on this topic, really detailed explanation. loved it

  • @9411180906
    @9411180906 7 років тому +1

    I don't know why there aren't much likes,
    But seriously man this is the best explanation of merge sort
    hats off :)...

  • @peterstephanos6959
    @peterstephanos6959 4 роки тому +1

    Best Explanation for recursive function, Thank You Very Much.

  • @irvirv8243
    @irvirv8243 4 роки тому +1

    Guys I finally understand it Nice video the call stack idea is genius

  • @wycliffeo4656
    @wycliffeo4656 Рік тому +1

    i think i will need to watch this 10 times but superb explanation thanks

    • @ComputerScienceLessons
      @ComputerScienceLessons  Рік тому

      Thank you. It can take a while to fully understand this. Take your time with it. :)KD

  • @johndunne3983
    @johndunne3983 7 років тому

    This explanation is fantastic, great job Kevin :)

  • @SanmathiBharamgouda
    @SanmathiBharamgouda 7 років тому

    thanks so much for this upload. you are a savior!

  • @zameelnm2365
    @zameelnm2365 6 років тому

    WOW....... I really love this. You really gave me what i want.

  • @003kazimehrabrashid4
    @003kazimehrabrashid4 6 років тому +1

    bestest bestest bestest tutorial i have ever seen.

  • @govind999
    @govind999 7 років тому

    good one and nicely explained, i was exactly looking something like this.

  • @K9amilo90
    @K9amilo90 4 роки тому

    Wonderful! Thanks, sir

  • @iMakeYoutubeConfused
    @iMakeYoutubeConfused 4 роки тому +1

    felt like reading a novel :P
    Thanks for this great video!

  • @kquat7899
    @kquat7899 5 років тому

    Very good tutorial.

  • @eirikpettersen3257
    @eirikpettersen3257 6 років тому

    Great explanation.

  • @hamstergaming1792
    @hamstergaming1792 6 років тому

    what is meant by Sub.. is it the same as Function. because i want to write the complete pseudocode for this. to me it looks like i have to include these 3 functions in the same program. but the dividing part is a sub in this, not a function. what is the reason behind this?

    • @ComputerScienceLessons
      @ComputerScienceLessons  6 років тому +1

      Sub can be read as 'procedure' . It is short for Sub Procedure in VB. (Spot the VB programmer!)

    • @hamstergaming1792
      @hamstergaming1792 6 років тому

      ah ok thanks mate. i got a little confused there

  • @dexterellis7973
    @dexterellis7973 5 років тому +1

    Thank you!

  • @ТимурГалимов-л5ю
    @ТимурГалимов-л5ю 3 роки тому +1

    Awesome!

  • @simonribas4625
    @simonribas4625 2 роки тому +1

    I always was confused why people think "sorting algos" are easy... sure the idea of them are easy but implementation haha.. that's another story!

    • @ComputerScienceLessons
      @ComputerScienceLessons  2 роки тому

      Agreed. I urge my students to try to implement algorithms with code, if they want to truly understand them. Oddly, in the UK, we teach the principle of the merge sort to 14 year old GCSE students, which I think is premature. Even the most able A Level students struggle to implement it. If nothing else, they come to appreciate it's beauty, and the genius of John Von Neumann :)KD

  • @nayanpanday420
    @nayanpanday420 Рік тому

    source code pls