Merge sort algorithm

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • See complete series on sorting algorithms here:
    • Sorting Algorithms
    In this lesson, we have explained merge sort algorithm. Merge sort is a divide and conquer algorithm that has worst case time complexity of O(nlogn).
    See source code of real implementation here -
    gist.github.co...
    For more such videos and updates, subscribe to our channel.
    You may also like us on facebook:
    / mycodeschool

КОМЕНТАРІ • 1,2 тис.

  • @RahulGupta-vd2ns
    @RahulGupta-vd2ns 4 роки тому +1074

    *4 years back when I was in college I studied for my exams from this video. 2 years later I watched this video for my placements. Now I'm switching my job and I already know where to go for Sorting lectures. Still the best!*

    • @gsuprajagoli5764
      @gsuprajagoli5764 4 роки тому +8

      Great

    • @jalsacentre1040
      @jalsacentre1040 3 роки тому +2

      Hi

    • @hackzyoboy2459
      @hackzyoboy2459 3 роки тому +30

      Man we are on the same boat. Exactly the reason why I am here for the nth time. Mycodeschool is really my first and last school to excel.

    • @cpwithsundar
      @cpwithsundar 3 роки тому +2

      Sorry for asking. I am a beginner .
      is sorting that important that it takes these many years to master?

    • @RahulGupta-vd2ns
      @RahulGupta-vd2ns 3 роки тому +15

      @@cpwithsundar When you'll start using Arrays.sort or other lib functions eventually you'll forget how these work

  • @abhishekverma5928
    @abhishekverma5928 3 роки тому +118

    These videos are 7 year old , but still no body can touch the level of these videos. I watch so many tutorials but no-one provide such clarity. Bow down to you man. Really appreciate your work.

    • @AvidLearner11
      @AvidLearner11 3 роки тому +3

      Yep. There won't be a need for any others. The thing about a lot of branches of mathematics - once certain algorithms / properties are discovered, they won't change. Not for hundreds and thousands of years. Occasionally we find more efficient ways to prove / achieve the same results.

  • @haritar9053
    @haritar9053 8 років тому +321

    18 minutes of complete understanding vs 24 hours of breaking my head. Thank you so much!

  • @YoussefAlfikey
    @YoussefAlfikey 2 місяці тому +2

    2024 and still one of the best tutorials in this topic, thanks bro

  • @gregt194
    @gregt194 3 роки тому +20

    This video is legendary, it's like an archive of all CS students coming here to learn after professors can't explain it well. From comments made 6 years ago to 5 months ago, no one leaves confused

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

      its low key sad but im grateful to those who make these videos

  • @locle9389
    @locle9389 4 роки тому +16

    Your lecture meant a lot to me. I was on the verge of quitting college and computer science for good because I don't understand anything my professor taught. I was ashamed and full of self doubt and I often beat myself up because I struggled so hard to understand recursive and algorithm but making absolutely no progress at all until I found your video. Your teaching gave me hope and is the reason why I'm still hanging in there. You're an inspiration so pls don't stop what you're doing, I won't forget what you'd done. Thank You!

  • @nnmartin94
    @nnmartin94 4 роки тому +216

    One of the few accents of the world that I trust and feel safe with when it comes to learning CS

  • @AmanKUMAR-vq1ls
    @AmanKUMAR-vq1ls 3 роки тому +26

    I am studying this in April2021, still it's the best. No one can match this level, bahut bada change ho gya hota indians ka coding level agar Aaj bhi wo team work kr rhi hoti.. RIP Harsha,, u are immortal

    • @manishsharma2211
      @manishsharma2211 3 роки тому +3

      The Lord Harsha

    • @RandomSerialKiller
      @RandomSerialKiller 3 роки тому +3

      True brother I can't believe this playlist is actually 8 years old, still best on internet.

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

    Why youtube videos are greater and more helpful than school and university?
    tnx a lot dude

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

    Just came to know that one of the the co-founder of this channel Harsha passed away few years back, may he rest in peace. Your videos have been helpful ever since college to this point.

    • @sohamhegde2386
      @sohamhegde2386 3 роки тому

      Any idea who are the other founders?

    • @vandankumbhat5391
      @vandankumbhat5391 3 роки тому

      @@sohamhegde2386Don't remember but you can google that. Seems the channel is still running.

  • @amarsinghraghuvanshi4553
    @amarsinghraghuvanshi4553 2 роки тому +2

    This is 9 year old video but it doesn't seem , the way he tell the concept so patiently and beautiful all doubt get eradicate and sense of understanding built with crystal clear logic .

  • @kevinberlanga2671
    @kevinberlanga2671 3 роки тому +2

    This is hands down the best explanation of Merge Sort. No other video breaks it down the way you did. Thank you so much!

  • @TejaKarlapudi
    @TejaKarlapudi 5 років тому +8

    Never thought Merge sort was this easy. I was able to code Merge Sort algorithm myself after watching this video! Thank you, pal!

    • @OmPrakash-sl4if
      @OmPrakash-sl4if 3 роки тому

      Brother ❤️❤️❤️Fan of Being techster❤️❤️❤️

  • @dangidelta
    @dangidelta 5 років тому +2

    Out of the 3 techniques studied so far, this one, undoubtedly, stands the most elegant in all its form and execution. It's just beautiful to watch every little piece, in the end, fit itself in the right place automagically.

  • @natashagupta913
    @natashagupta913 10 років тому +41

    Excellent videos! I have been trying to study for them for days and none of the other videos match the completeness of your videos..thank u so much for posting!

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

    These videos had a significant impact on my algorithmic thinking. I'm grateful that I found these videos in first semester of college 7 years ago.

  • @parikshit475
    @parikshit475 6 років тому +21

    Wow, 100% perfection & clarity. U R The Best Indian coder.

  • @jenna4523
    @jenna4523 3 роки тому +69

    I watch these videos instead of my professor's online lectures

  • @rosalindrier4070
    @rosalindrier4070 2 роки тому +3

    I never comment on youtube, but this guy's explanation is phenomenal. Thank you sir

  • @gowdhamt1651
    @gowdhamt1651 10 місяців тому +1

    Thank for your great work, I have watched this long back and am still watching now to get refreshed on these topics. And your content gives that satisfaction of how nice it will be once you understand something. Thanks again.

  • @CseyCorpus
    @CseyCorpus 10 років тому +50

    What a high quality teaching!!! With this type of instructor, if you don't get an A in the class, you must really be dumb. Keep the good teaching. I wish some of my instructors could explain things with this details. Really cool following your tutorial.

    • @mycodeschool
      @mycodeschool  10 років тому +4

      Thanks a lot CseyCorpus

    • @maresfillies6041
      @maresfillies6041 10 років тому +3

      I think the main issue is that instructors like to teach very formally, but it should be done informally first. Then formally. This is how it should be taught. :)

    • @suriyakhaled6579
      @suriyakhaled6579 6 років тому +2

      I must be really dumb because I have never gotten an A in any of my courses at Uni. I am in my third year. 😂😂My best grade is A-...

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

      your dumb for thinking that examination can determine a persons intelligence.

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

    HANDS DOWN THE BEST CHANNEL FOR PROGRAMMING CONCEPTS!

  • @sovichettep
    @sovichettep 10 років тому +74

    I've been through many videos of yours, and I can't stop telling my friends to come into your channel to watch. Your explaination is great. You explain the concept very well and, yeah, the visualization of each algorithm process is also easy to understand. :)

  • @NadinMagdy
    @NadinMagdy 3 роки тому

    I keep coming to you videos every couple of years when I need them. Still the best!

  • @AranFatih
    @AranFatih 7 років тому +3

    i know a lot of people say that "hey you explain better than my professor", but for real merge sort was a nightmare since my class, but i could wrote the code myself with just your explanation. Thank you!

  • @bookalicious9849
    @bookalicious9849 3 роки тому

    Its been 2021 but still cant find a better dsa series than mycodeschool !!

  • @danielzuzevich4161
    @danielzuzevich4161 3 роки тому +5

    Not all heroes wear capes...

  • @KPenceable
    @KPenceable 9 років тому +1

    Genius idea making these videos widescreen. Can't wait to see this on IMAX

  • @PhucNguyen-gb7ul
    @PhucNguyen-gb7ul 5 років тому +4

    Thanks a lot for your clarification about Merge Sort!!! It is super helpful. I used to not understand because recursion is a struggle for me. But now, I can understand better.

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

    You're better than my professor. I exhausted my brain with my professor's teaching, now I am not worried anymore. Thank you!

  • @MrW3iss
    @MrW3iss 9 років тому +528

    Great explanation, thorough and clear. You should consider teaching at university if you don't already! Better than most of my professors :p

    • @charlesz5949
      @charlesz5949 7 років тому +10

      what year do they teach this in university? Im learning this in grade 12 right now

    • @MrW3iss
      @MrW3iss 7 років тому +12

      I think freshman or sophomore?

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

      Ryan Weiss what are some stuff you learned in freshman? thanks

    • @MrW3iss
      @MrW3iss 7 років тому +36

      Charles Z As a freshman they usually require you to take all beginner/common courses all various disciplines, then you start specializing your second year on when you declare a major and/or minor. First years of programming were basics of Java, how computers work, how programming works, all that stuff, very simple. Figure out what you want to learn, and then find a course that will be suitable. I taught myself most of what I know programming-wise early on, and didn't get much out of college, except some neat stuff like how to make your own languages, AI was kinda difficult, otherwise things we're fairly basic. Most of the stuff around CS when I was in college was a mix of theory and implementation, ie. sorting algorithms and graph traversals and all that kind of stuff, but they won't try to stick you with any specific technology, so they have to broaden their approaches to teaching, and for that reason it's tough to find a course that specialized skillsets can benefit from. Advanced CS courses can offer things like cryptography, AI, data mining, etc So just figure out what interests you, then how you can do it, and go for it. Lots to learn on the internet as well, but it's nice to be able to work it through with others if that's how you learn best. Best wishes.

    • @chaudharyadityakumar6149
      @chaudharyadityakumar6149 6 років тому +19

      what if I tell u the guy teaching died in 2014 at very young age.

  • @aayushsingh9622
    @aayushsingh9622 6 років тому +2

    My head was spinning when i tried to understand the merge sort by myself , thanks to your tutorial the logic of the algo is now pretty clear to me in a single instance.
    All the best,Keep up the good work

  • @md-ayaz
    @md-ayaz 8 років тому +297

    You are making India proud.

    • @eosapril
      @eosapril 8 років тому +7

      +Mohmmad Ayaz Shaikh i understand nothing from this India...

    • @adelECDW
      @adelECDW 8 років тому +9

      Use closed captions on any youtube video you cant understand. Its the "CC" button in the bottom right corner of any video.

    • @xinli7477
      @xinli7477 7 років тому +26

      @Eos April Seriously? English is not even my mother language and I understand fine.

    • @rajatsharma7596
      @rajatsharma7596 6 років тому +3

      Eos April lol .. rip for uh then !! english lang. is not our mother lang. but still we indian can easily understand it either its american or UK english... nd uh people still remain as a dumb 😂

    • @josephcbugajski7105
      @josephcbugajski7105 5 років тому +11

      I now click on the programming videos from India first.

  • @jedng9639
    @jedng9639 3 роки тому

    8 years on and this is still the only video I need to watch to understand merge sort. Thank you sir!

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

    I was breaking my head for this merge sort and your explanation was perfect. Thank you Soo much. I watched twice and I implemented this on my own in JAVA the code is working great.

  • @vivs005
    @vivs005 10 років тому +1

    This is ridiculously the best explanation ever on the internet. I don't know if anyone who doesn't understands this will probably get an easier explanation anywhere. Thanks a lot dude. You explained the algo so well using pseudo code I could very well right my own code, in fact anyone should be able to.

  • @yarial821
    @yarial821 Рік тому +4

    I have almost give up Computer Science / Programming. I was never a CS student, and I failed my first coding test when I was interviewing for a software engineering position. At that time, I didn't even know how a Linked List work.
    I think it's around 3 years ago, I found this channel. The videos here inspired me what programming foundation is all about. I come back to this channel from time to time to clear my concepts on DS&A.
    Today, I am a Data Scientist, and I am coming back again because I am having an interview from my dream company - one of the FANGs. I am sure that the content of this channel will help me to get through the interview.
    I really want to pay tribute to myCodeSchool, because it just democratise the knowledge of Computer Science. It also inspires the world that, as long as you have a good teacher, you can learn anything you want.

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

    Videos uploaded in 2013. After 9 years still relevant. That's what quality content it. I wish you upload more videos on your channel

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

    The best explanation of merge sort recursion
    U really need to consider becoming a prof if not already.

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

    This channel was way ahead of its time!

  • @paraipansorin2192
    @paraipansorin2192 5 років тому +3

    Genius, you helped me get a 10 at A&DS, I apreciate your work!!

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

    Well done! So hard to find folks that know technical subject matter well, while at the same time are able to communicate what they know well!

  • @robomextv
    @robomextv 7 років тому +44

    Pseudo code was awesome clearly explained

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

    Bro this video is awesome, thank you so much. 9 years later i spent all my morning on the internet trying to understand this until I found you!

  • @kartaLaLa
    @kartaLaLa 9 років тому +56

    thanks a lot, you save my lab homework , I stuck on this hard algorithm :)!!
    thank you very much.
    Department of Computer Science, National Chiao Tung University ,Taiwan

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

    My friend, i've been watching all kind of videos, about computer science, data structure, engeneering, etc, and I've never watched a so well-explained video this.

  • @sarajilani8088
    @sarajilani8088 10 років тому +5

    Thanku soooo much.. U explained better than any textbook could have :)

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

    I just love the way you have explained the whole concept, Easy ,fast, understandable and most important easy to code

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

    Yes I agree I am actually getting a clear understanding as well as gaining a new insight to recursion based on how you teach. You teach both from theoretical as well as programmatic (practical) and actually show what is going on in the stack which is really cool.
    Can you teach the Minimax algorithm for applications to something simple like Tic Tac Toe ?

  • @alive4metal731
    @alive4metal731 2 роки тому +2

    Best explanation of merge sort I've seen.

  • @mdalam-yy7gq
    @mdalam-yy7gq 11 років тому +5

    First of all, this lecture help me to understand how divide and conquer works, then how merge sort actually works and why the time complexity of merge sort is nlogn. Finally, it also help me to gain the basic knowledge of recursion. God bless you.
    CS Student - Stony Brook University.

    • @mycodeschool
      @mycodeschool  11 років тому +2

      Hi Alam,
      Glad that you found this lesson useful. Thanks for your wishes.

  • @pathapac
    @pathapac 7 років тому +2

    You have immense talent in simplifying things ! Keep up the great job. Thanks a TON !

  • @mycodeschool
    @mycodeschool  10 років тому +54

    See source code of real implementation here:
    gist.github.com/mycodeschool/9678029

    • @IndrajithIndraprastham
      @IndrajithIndraprastham 10 років тому +10

      Really useful video. Keep posting videos like this. I am just wondering how you make videos like this? What are the software used to create these drawings? Are you using any pen device to write with this precession or your control with mouse is just excellent? Thank you

    • @yash1990singla
      @yash1990singla 9 років тому +3

      Indrajith Indraprastham
      They have a blog entry about this. blog.mycodeschool.com/2013/11/how-to-create-amycodeschool-style-video.html

    • @veerendra.k
      @veerendra.k 9 років тому +1

      mycodeschool
      Thanks for the nice explanation.
      In that
      At line numbers 20 and 21 in the above code. (you mentioned in that link)
      while(i < leftCount) A[k++] = L[i++];
      while(j < rightCount) A[k++] = R[j++];
      Instead of while loop, can we use "IF"? or is there any specific reason
      for "WHILE"?. Because, after exiting the main while loop(line no. 16),
      there should be 1 element left either in left array or right array.
      For example, if the condition in mail while loop fails, the control
      goes to 2nd or 3 rd while loop. In those loops, we are not checking any
      conditions, simply putting the remaining elements in main array.Then why
      we are using WHILE loop? I hope you understood what I'm saying or may
      be I misunderstood the algorithm. Thanks!

    • @sagarmitra4249
      @sagarmitra4249 8 років тому

      i need source code without useing pointer

    • @cesarjom
      @cesarjom 8 років тому

      +Veerendra Kakumanu - no, it is not correct to think that (for all cases) only 1 element will remain in L or R arrays, after first while() loop exits. Consider this example of merging the following arrays: L = {1,2} and R = {3,4}.

  • @JigarShah2811
    @JigarShah2811 8 років тому

    mycodeschool is the best resource to visually understand DS algo. We are eagerly awaiting for more recent videos on new topics.

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

    Amazing man!! Still watching in 2019!

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

    At first, I fast forwarded this video and didn't like it. Then I read the comments and decided to watch it from the beginning without skipping any parts of it. Now, I totally agree with all of those comments. Great explanation sir.

  • @vivekmishra007
    @vivekmishra007 8 років тому +8

    RIP humblefool ( Harsha Suryanarayana) Thank you for everything .

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

      The tutor in the video is Animesh Nayan, Harsha's junior and Co-founder from MyCodeSchool.
      Read more at: yourstory.com/2014/06/techie-tuesdays-humblefool

  • @mitch5253
    @mitch5253 5 років тому +2

    best explanation over whole youtube merge sort videos

  • @omkarbhise380
    @omkarbhise380 9 років тому +5

    It's really better than reading big reference books

  • @SuperJAIMISH
    @SuperJAIMISH 7 років тому +2

    I always felt like the mergesort was daunting to implement so I never tried. And you have made it so easy to understand, cheers mate!

  • @FilipCodes
    @FilipCodes 6 років тому +3

    Thank you for this bro! Explained perfectly!! Keep up on good work.

  • @mizuhashitsunoka
    @mizuhashitsunoka Місяць тому

    I saw this video in my college's second semester or second year I believe. Still as good as it was. It's prolly 7 years for me amd I am revisiting it to prepare for interviews. Really scared how it will go but hearing this voice really assured me that I had learnt it correctly. I don't know your name but I do hope that you are in a better place as your legacy has probably helped millions get through their exams.

  • @MatejKripner
    @MatejKripner 8 років тому +13

    "One of the halves will have more elements than the other half" :D Anyway, great video!

    • @nikhilb3880
      @nikhilb3880 4 роки тому +8

      I understood that video faster than this comment.

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

      Does true half exist outside of theoretical math? Infinitesimal numbers would argue.

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

    omg i was literally stuck at the recursive part cause none of the youtube videos i found actually explained how the recursion worked and i banged my head for 1 day.
    thank you

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

      i can now use this knowledge to code slow sort algorithm into my assignment

  • @mahmedfarid3201
    @mahmedfarid3201 7 років тому +3

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

    This was a great tutorial. Very clearly presented. The subtitles while not needed is a nice touch. Awesome job!!

  • @DamaiSubimawanto
    @DamaiSubimawanto 9 років тому +3

    Thank you very much. Your explanation is very clear! You're awesome dude!

  • @neelanshsharma275
    @neelanshsharma275 11 місяців тому +2

    Thanks sir for helping us build a strong foundation in DSA by blessing us with such amazing lectures. Words are not enough to express my gratitude.

  • @benjaminmiao3630
    @benjaminmiao3630 6 років тому +38

    Your teaching efficiency is lg n, which I like very much. But our teacher’s teaching efficiency is 2^n...

    • @SV-zi9os
      @SV-zi9os 6 років тому +29

      nigga du u understand that higher efficiency is better.

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

      @@SV-zi9os shut the fuck up moron

    • @subhamsarkar251
      @subhamsarkar251 5 років тому +4

      Benjamin Nitro you troll urself man 😂😂

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

    I have never used merge sort before. But after having watched your video I could write the code for it myself. With a little glancing at your pseudo code. Fantastic explanation, I'll have to have a look at your other videos.

  • @sayanneogy3079
    @sayanneogy3079 5 років тому +4

    I need a love react in UA-cam especially for this video!!!🖤🖤🖤

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

    This is incredible. I'm was in the same situation as many others commenting - I have watched many videos and read a few text books explaining Merge Sort and hands down this video nails the concept and code wonderfully! Simple and concise, thank you.

  • @robomextv
    @robomextv 7 років тому +3

    Loved the way u explained

  • @z3jlewhhda376
    @z3jlewhhda376 3 роки тому

    Best sorting lectures I ever have seen on UA-cam!

  • @gauravrawat8959
    @gauravrawat8959 5 років тому +4

    How can people dislike this video.....either they must be from some other planet or must be heavily drunk....

  • @amanshukla7273
    @amanshukla7273 8 років тому

    Thanks mycodeschool for clearcut and precise explanation of sorting.

  • @gena8414
    @gena8414 5 років тому +12

    The explanation in CLRS is really very lousy. Thank heavens you made this video.

  • @hippohugz9966
    @hippohugz9966 3 роки тому

    thankyou only place who actually explains how the recusrion aspect works for mergesort

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

    u r a daddy programmer .excellent teaching skill .

  • @sparrowthesissy2186
    @sparrowthesissy2186 8 років тому

    Absolutely clear. I'll recommend this video to anyone looking to learn about merge sort. This makes it about as simple as it could be.

  • @numi
    @numi 10 років тому +3

    Sooo helpful. Thank you! :)

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

    I have seen several MergeSort videos. This one is the best one to explain MergeSort algorithm.

  • @dhirenlalwani9728
    @dhirenlalwani9728 6 років тому +15

    /* C program for Merge Sort */
    #include
    #include
    // Merges two subarrays of arr[].
    // First subarray is arr[l..m]
    // Second subarray is arr[m+1..r]
    void merge(int arr[], int l, int m, int r)
    {
    int i, j, k;
    int n1 = m - l + 1;
    int n2 = r - m;
    /* create temp arrays */
    int L[n1], R[n2];
    /* Copy data to temp arrays L[] and R[] */
    for (i = 0; i < n1; i++)
    L[i] = arr[l + i];
    for (j = 0; j < n2; j++)
    R[j] = arr[m + 1+ j];
    /* Merge the temp arrays back into arr[l..r]*/
    i = 0; // Initial index of first subarray
    j = 0; // Initial index of second subarray
    k = l; // Initial index of merged subarray
    while (i < n1 && j < n2)
    {
    if (L[i]

  • @m.praneeth9086
    @m.praneeth9086 Рік тому +1

    Thank u for making my day happy and through This learning Channel is great you know! I am getting this sort now. I think I can manage recursion and I can write it on my own now . Thanks for every thing u did❤

  • @spacezombie99
    @spacezombie99 9 років тому +7

    Dear #mycodeschool
    These video lectures are simply amazing. Thank you so much. I just have a question, in your implementation how are you free-ing the memory allocated for left and right arrays using malloc?

    • @mycodeschool
      @mycodeschool  9 років тому +3

      Good catch vandana r ! The arrays should be freed. They are created using malloc, so they should be freed explicitly at end of the MergeSort function. Modified the code.

    • @Mitche23
      @Mitche23 9 років тому

      mycodeschool It this was written .NET framework you wouldn't have to worry about memory allocation and dealocation

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

      yeah but also would cut ur market into a third

  • @naveenkumarreddy2204
    @naveenkumarreddy2204 3 роки тому

    No word's. Best explanation I have ever seen for merge sort algorithm

  • @pranavganorkar2379
    @pranavganorkar2379 10 років тому +4

    Great Video... I only have one doubt how will we determine the length n of array A in function MergeSort() in real C code? i tried running int n=(sizeof(A)/sizeof(A[0])) but its not working inside MergeSort()..i think we will have to give size n as parameter to MergeSort()....

    • @pranavganorkar2379
      @pranavganorkar2379 10 років тому +1

      oh so sorry I didnt saw the github source code... many thanks for the source code...now i understood it's implementation clearly....

  • @dzlee218
    @dzlee218 8 років тому

    why are you so good at explaining stuffs? please make more videos! I watched all the ads so you can make money out of it.

  • @Kovai-Siva
    @Kovai-Siva 10 років тому +4

    Thanks for the video. Have a question,
    what will be the time complexity of merge sort for avg and best case? I think this is also O(n log n). Am i right?

  • @7IdusOrtus15
    @7IdusOrtus15 10 років тому +2

    Prior to watching your video I knew how to implement a merge sort and regurgitate the underlying logic, but I didn't really own the knowledge. The first 12 minutes of your tutorial connected the few missing links in my logic chain that a lecture and several hours of reading couldn't. Thank you very much!

  • @reynoldyehezkiel
    @reynoldyehezkiel 5 років тому +14

    2019?

  • @someone_69264
    @someone_69264 14 днів тому

    Prime level of teaching that no one can't even touch

  • @amandeepsaxena9579
    @amandeepsaxena9579 8 років тому +3

    for average case we will use theta notation not the Big O notation.

    • @hasnainahmad6195
      @hasnainahmad6195 8 років тому

      chup kr ja bhai. pata hay nae kuch bakwass kr rha h theeta ka bacha

    • @amandeepsaxena9579
      @amandeepsaxena9579 8 років тому

      Ohh...tameez seekh le...gwaar...tb kuch seekhana..

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

      hahah lodhuuu
      @@amandeepsaxena9579

  • @satyakiguha415
    @satyakiguha415 10 років тому +2

    I don't know how to thank you guys.........you cannot imagine how useful your videos are for college students....keep up the good work and I shall be much obliged if you could include lessons on heap,radix,shell sort and other sorting algorithms as well.......Thank you once again

  • @Rjsipad
    @Rjsipad 9 років тому +7

    I like when he says swapping. It's pronounced swopping.... not swapping xD but great video

    • @rajgurujavalagaddi5133
      @rajgurujavalagaddi5133 7 років тому +15

      this is not english class u idiot

    • @MaxUP2
      @MaxUP2 7 років тому +3

      It's pronounced swäp so he is right.

    • @AbhishekKumar-lp5rc
      @AbhishekKumar-lp5rc 7 років тому +2

      it's depends on your accent and what regional variations in the language.

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

    dont know if i got this or not......but sure can say that this is by far the best explanation out here in youtube.

  • @anurocksification
    @anurocksification 11 років тому +4

    take a bow sir !!

  • @poggybitz513
    @poggybitz513 9 місяців тому

    this is the first video where I understood the merge sort. thank you so much for this.

  • @shlokisthebest
    @shlokisthebest 8 років тому +19

    papa ko pranam _/\_.,, arey!!!

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

    Great job explaining. You turned something complex into something anyone with basic programming skills could understand. Thanks!