Merge sort algorithm

  Рет қаралды 2,254,672

mycodeschool

mycodeschool

11 жыл бұрын

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.com/mycodeschool/...
For more such videos and updates, subscribe to our channel.
You may also like us on facebook:
/ mycodeschool

Пікірлер: 1 200
@RahulGupta-vd2ns
@RahulGupta-vd2ns 4 жыл бұрын
*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 3 жыл бұрын
Great
@jalsacentre1040
@jalsacentre1040 3 жыл бұрын
Hi
@hackzyoboy2459
@hackzyoboy2459 3 жыл бұрын
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 жыл бұрын
Sorry for asking. I am a beginner . is sorting that important that it takes these many years to master?
@RahulGupta-vd2ns
@RahulGupta-vd2ns 3 жыл бұрын
@@cpwithsundar When you'll start using Arrays.sort or other lib functions eventually you'll forget how these work
@abhishekverma5928
@abhishekverma5928 3 жыл бұрын
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 жыл бұрын
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.
@nnmartin94
@nnmartin94 3 жыл бұрын
One of the few accents of the world that I trust and feel safe with when it comes to learning CS
@adityabhardwaj7022
@adityabhardwaj7022 3 жыл бұрын
Indian accent 😐
@schoudhury3463
@schoudhury3463 3 жыл бұрын
Lol
@schoudhury3463
@schoudhury3463 3 жыл бұрын
Where are you from
@katdareshruti
@katdareshruti 3 жыл бұрын
@@schoudhury3463 I think India😉😄
@AvidLearner11
@AvidLearner11 3 жыл бұрын
LOLOLOLOL
@locle9389
@locle9389 4 жыл бұрын
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!
@haritar9053
@haritar9053 7 жыл бұрын
18 minutes of complete understanding vs 24 hours of breaking my head. Thank you so much!
@wentaoliu1864
@wentaoliu1864 6 жыл бұрын
Same here!
@RamanKumar-uf5bv
@RamanKumar-uf5bv 5 жыл бұрын
exactly
@srivalli5025
@srivalli5025 2 жыл бұрын
Pls explain me
@anjalikhobragade7063
@anjalikhobragade7063 2 жыл бұрын
What .
@raphaelramos4016
@raphaelramos4016 2 жыл бұрын
You're lucky guy. Me, it takes 3 days til watch this video and understand the whole thing
@AmanKUMAR-vq1ls
@AmanKUMAR-vq1ls 3 жыл бұрын
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 жыл бұрын
The Lord Harsha
@RandomSerialKiller
@RandomSerialKiller 2 жыл бұрын
True brother I can't believe this playlist is actually 8 years old, still best on internet.
@gregt194
@gregt194 2 жыл бұрын
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 Жыл бұрын
its low key sad but im grateful to those who make these videos
@sovichettep
@sovichettep 9 жыл бұрын
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. :)
@natashagupta913
@natashagupta913 10 жыл бұрын
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!
@mycodeschool
@mycodeschool 10 жыл бұрын
Thanks Natasha Gupta :)
@mycodeschool
@mycodeschool 10 жыл бұрын
See source code of real implementation here: gist.github.com/mycodeschool/9678029
@IndrajithIndraprastham
@IndrajithIndraprastham 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 жыл бұрын
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 8 жыл бұрын
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}.
@kevinberlanga2671
@kevinberlanga2671 3 жыл бұрын
This is hands down the best explanation of Merge Sort. No other video breaks it down the way you did. Thank you so much!
@jenna4523
@jenna4523 3 жыл бұрын
I watch these videos instead of my professor's online lectures
@mohammedsharikuzama5518
@mohammedsharikuzama5518 3 жыл бұрын
Lol same
@parikshit475
@parikshit475 5 жыл бұрын
Wow, 100% perfection & clarity. U R The Best Indian coder.
@vandankumbhat5391
@vandankumbhat5391 4 жыл бұрын
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.
@dangidelta
@dangidelta 4 жыл бұрын
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.
@aayushsingh9622
@aayushsingh9622 5 жыл бұрын
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
@replykh4642
@replykh4642 2 жыл бұрын
Why youtube videos are greater and more helpful than school and university? tnx a lot dude
@CseyCorpus
@CseyCorpus 10 жыл бұрын
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 жыл бұрын
Thanks a lot CseyCorpus
@maresfillies6041
@maresfillies6041 9 жыл бұрын
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 жыл бұрын
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 жыл бұрын
your dumb for thinking that examination can determine a persons intelligence.
@HamzahAkhtar1
@HamzahAkhtar1 4 жыл бұрын
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.
@jedng9639
@jedng9639 3 жыл бұрын
8 years on and this is still the only video I need to watch to understand merge sort. Thank you sir!
@TejaKarlapudi
@TejaKarlapudi 5 жыл бұрын
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 2 жыл бұрын
Brother ❤️❤️❤️Fan of Being techster❤️❤️❤️
@MrW3iss
@MrW3iss 9 жыл бұрын
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 жыл бұрын
what year do they teach this in university? Im learning this in grade 12 right now
@MrW3iss
@MrW3iss 7 жыл бұрын
I think freshman or sophomore?
@charlesz5949
@charlesz5949 7 жыл бұрын
Ryan Weiss what are some stuff you learned in freshman? thanks
@MrW3iss
@MrW3iss 7 жыл бұрын
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 жыл бұрын
what if I tell u the guy teaching died in 2014 at very young age.
@amarsinghraghuvanshi4553
@amarsinghraghuvanshi4553 Жыл бұрын
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 .
@himanshuinca
@himanshuinca 5 жыл бұрын
I just love the way you have explained the whole concept, Easy ,fast, understandable and most important easy to code
@AranFatih
@AranFatih 6 жыл бұрын
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!
@amareshkarnan7462
@amareshkarnan7462 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.
@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.
@bookalicious9849
@bookalicious9849 3 жыл бұрын
Its been 2021 but still cant find a better dsa series than mycodeschool !!
@rosalindrier4070
@rosalindrier4070 2 жыл бұрын
I never comment on youtube, but this guy's explanation is phenomenal. Thank you sir
@md-ayaz
@md-ayaz 8 жыл бұрын
You are making India proud.
@eosapril
@eosapril 8 жыл бұрын
+Mohmmad Ayaz Shaikh i understand nothing from this India...
@adelECDW
@adelECDW 8 жыл бұрын
Use closed captions on any youtube video you cant understand. Its the "CC" button in the bottom right corner of any video.
@xinli7477
@xinli7477 6 жыл бұрын
@Eos April Seriously? English is not even my mother language and I understand fine.
@rajatsharma7596
@rajatsharma7596 5 жыл бұрын
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 жыл бұрын
I now click on the programming videos from India first.
@gowdhamt1651
@gowdhamt1651 7 ай бұрын
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.
@ten2the6
@ten2the6 7 жыл бұрын
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!
@PhucNguyen-gb7ul
@PhucNguyen-gb7ul 5 жыл бұрын
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.
@robomextv
@robomextv 6 жыл бұрын
Pseudo code was awesome clearly explained
@tonyvumbaca2597
@tonyvumbaca2597 7 жыл бұрын
Such a great job explaining this concept. This is the best walk through of the merge sort algorithm I have seen so far. Especially how you show the order in which the machine handles each step of the recursion process. Thanks for making this video!
@pathapac
@pathapac 6 жыл бұрын
You have immense talent in simplifying things ! Keep up the great job. Thanks a TON !
@paraipansorin2192
@paraipansorin2192 5 жыл бұрын
Genius, you helped me get a 10 at A&DS, I apreciate your work!!
@absolutezero8
@absolutezero8 4 жыл бұрын
The best explanation of merge sort recursion U really need to consider becoming a prof if not already.
@zohakhan6198
@zohakhan6198 3 жыл бұрын
HANDS DOWN THE BEST CHANNEL FOR PROGRAMMING CONCEPTS!
@vivs005
@vivs005 10 жыл бұрын
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.
@zichunyuan2732
@zichunyuan2732 5 жыл бұрын
Amazing man!! Still watching in 2019!
@SpencerDavis2000
@SpencerDavis2000 5 жыл бұрын
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 ?
@SuperJAIMISH
@SuperJAIMISH 7 жыл бұрын
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!
@akshatw7866
@akshatw7866 3 жыл бұрын
This channel was way ahead of its time!
@FilipCodes
@FilipCodes 6 жыл бұрын
Thank you for this bro! Explained perfectly!! Keep up on good work.
@DamaiSubimawanto
@DamaiSubimawanto 9 жыл бұрын
Thank you very much. Your explanation is very clear! You're awesome dude!
@NadinMagdy
@NadinMagdy 3 жыл бұрын
I keep coming to you videos every couple of years when I need them. Still the best!
@7IdusOrtus15
@7IdusOrtus15 10 жыл бұрын
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!
@sarajilani8088
@sarajilani8088 10 жыл бұрын
Thanku soooo much.. U explained better than any textbook could have :)
@mycodeschool
@mycodeschool 10 жыл бұрын
Thanks a lot Sara :)
@kartaLaLa
@kartaLaLa 8 жыл бұрын
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
@sasaki0227
@sasaki0227 6 жыл бұрын
same here
@themusicguy1989
@themusicguy1989 5 жыл бұрын
Same Here
@themusicguy1989
@themusicguy1989 5 жыл бұрын
Not in the same school obviously lol
@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
@robomextv
@robomextv 6 жыл бұрын
Loved the way u explained
@omkarbhise380
@omkarbhise380 9 жыл бұрын
It's really better than reading big reference books
@TheCharlesCastro
@TheCharlesCastro 4 жыл бұрын
You're better than my professor. I exhausted my brain with my professor's teaching, now I am not worried anymore. Thank you!
@YouTubist666
@YouTubist666 6 жыл бұрын
This was a great tutorial. Very clearly presented. The subtitles while not needed is a nice touch. Awesome job!!
@dhirenlalwani9728
@dhirenlalwani9728 6 жыл бұрын
/* 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]
@simulink9564
@simulink9564 2 жыл бұрын
Hmm good
@vivekmishra007
@vivekmishra007 7 жыл бұрын
RIP humblefool ( Harsha Suryanarayana) Thank you for everything .
@kaal_bhairav_23
@kaal_bhairav_23 3 жыл бұрын
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
@z3jlewhhda376
@z3jlewhhda376 2 жыл бұрын
Best sorting lectures I ever have seen on KZfaq!
@faiax3133
@faiax3133 Жыл бұрын
This is Gold. This content will never die till Algorithms exists in this world.
@mdalam-yy7gq
@mdalam-yy7gq 10 жыл бұрын
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 10 жыл бұрын
Hi Alam, Glad that you found this lesson useful. Thanks for your wishes.
@yarial821
@yarial821 Жыл бұрын
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.
@-Corvo_Attano
@-Corvo_Attano Жыл бұрын
Great🤍
@mitch5253
@mitch5253 4 жыл бұрын
best explanation over whole youtube merge sort videos
@JigarShah2811
@JigarShah2811 8 жыл бұрын
mycodeschool is the best resource to visually understand DS algo. We are eagerly awaiting for more recent videos on new topics.
@mahmedfarid3201
@mahmedfarid3201 7 жыл бұрын
@numi
@numi 9 жыл бұрын
Sooo helpful. Thank you! :)
@captingin6
@captingin6 9 жыл бұрын
OHHH MY GOD THANK YOU SO MUCH. I was struggling trying to figure it out myself. Explaining how the commands are processed helped a ton.
@satyakiguha415
@satyakiguha415 10 жыл бұрын
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
@gena8414
@gena8414 4 жыл бұрын
The explanation in CLRS is really very lousy. Thank heavens you made this video.
@satyajeetjha1681
@satyajeetjha1681 7 жыл бұрын
u r a daddy programmer .excellent teaching skill .
@chaosinorderrr
@chaosinorderrr 10 жыл бұрын
Absolutely brilliantly explained! I cannot thank you enough. You should definitely do more Algorithm videos.
@KPenceable
@KPenceable 9 жыл бұрын
Genius idea making these videos widescreen. Can't wait to see this on IMAX
@sayanneogy3079
@sayanneogy3079 5 жыл бұрын
I need a love react in KZfaq especially for this video!!!🖤🖤🖤
@benjaminmiao3630
@benjaminmiao3630 6 жыл бұрын
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 жыл бұрын
nigga du u understand that higher efficiency is better.
@prince5922
@prince5922 5 жыл бұрын
@@SV-zi9os shut the fuck up moron
@subhamsarkar251
@subhamsarkar251 5 жыл бұрын
Benjamin Nitro you troll urself man 😂😂
@RafaelNascimento-qo1jp
@RafaelNascimento-qo1jp 4 жыл бұрын
Fantastic! I was striving to understand that algorithm for a long time, now everything pretty is clear! You have the ability to turn complex things into simple things!
@groverpf
@groverpf 9 жыл бұрын
You're making my revision for a data structures & algorithms exam easy!
@MatejKripner
@MatejKripner 8 жыл бұрын
"One of the halves will have more elements than the other half" :D Anyway, great video!
@nikhilb3880
@nikhilb3880 4 жыл бұрын
I understood that video faster than this comment.
@eulucaspedroabreu
@eulucaspedroabreu 4 жыл бұрын
Does true half exist outside of theoretical math? Infinitesimal numbers would argue.
@spacezombie99
@spacezombie99 9 жыл бұрын
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 жыл бұрын
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 6 жыл бұрын
yeah but also would cut ur market into a third
@sophies2103
@sophies2103 4 жыл бұрын
2020 and this is still the best channel! 🙏🏻
@neelanshsharma275
@neelanshsharma275 8 ай бұрын
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.
@pranavganorkar2379
@pranavganorkar2379 10 жыл бұрын
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 жыл бұрын
oh so sorry I didnt saw the github source code... many thanks for the source code...now i understood it's implementation clearly....
@gauravrawat8959
@gauravrawat8959 5 жыл бұрын
How can people dislike this video.....either they must be from some other planet or must be heavily drunk....
@mp0157
@mp0157 5 жыл бұрын
Nicely articulated by breaking the algorithm down into sub-modules that helped make sense of the recursion. Thank you, this helped!
@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.
@danielzuzevich4161
@danielzuzevich4161 3 жыл бұрын
Not all heroes wear capes...
@Kovai-Siva
@Kovai-Siva 10 жыл бұрын
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?
@valentacoder5461
@valentacoder5461 10 жыл бұрын
Correct!
@mycodeschool
@mycodeschool 10 жыл бұрын
Siva k : Yeah, its O(nlogn) for all cases.
@TheKrewboy101
@TheKrewboy101 6 жыл бұрын
Great job explaining. You turned something complex into something anyone with basic programming skills could understand. Thanks!
@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!
@reynoldyehezkiel
@reynoldyehezkiel 5 жыл бұрын
2019?
@tanmayhinge
@tanmayhinge 4 жыл бұрын
sorted -> 0 1 2 9
@sudhanshuuniyal5737
@sudhanshuuniyal5737 4 жыл бұрын
yes 2019.
@amandeepsaxena9579
@amandeepsaxena9579 7 жыл бұрын
for average case we will use theta notation not the Big O notation.
@hasnainahmad6195
@hasnainahmad6195 7 жыл бұрын
chup kr ja bhai. pata hay nae kuch bakwass kr rha h theeta ka bacha
@amandeepsaxena9579
@amandeepsaxena9579 7 жыл бұрын
Ohh...tameez seekh le...gwaar...tb kuch seekhana..
@chanpreetsingh5054
@chanpreetsingh5054 5 жыл бұрын
hahah lodhuuu @@amandeepsaxena9579
@shahirrahman7706
@shahirrahman7706 7 жыл бұрын
You Guys are Extraordinary .. Thanks for helping millions of people here !!
@kovco
@kovco 2 жыл бұрын
Really by far the best videos. Clear, understandable and complete! Thank you for your effort.
@anurocksification
@anurocksification 10 жыл бұрын
take a bow sir !!
@mycodeschool
@mycodeschool 10 жыл бұрын
Thanks a lot Anurag :)
@Rjsipad
@Rjsipad 9 жыл бұрын
I like when he says swapping. It's pronounced swopping.... not swapping xD but great video
@rajgurujavalagaddi5133
@rajgurujavalagaddi5133 7 жыл бұрын
this is not english class u idiot
@MaxUP2
@MaxUP2 6 жыл бұрын
It's pronounced swäp so he is right.
@AbhishekKumar-lp5rc
@AbhishekKumar-lp5rc 6 жыл бұрын
it's depends on your accent and what regional variations in the language.
@amanshukla7273
@amanshukla7273 8 жыл бұрын
Thanks mycodeschool for clearcut and precise explanation of sorting.
@huizhao2050
@huizhao2050 5 жыл бұрын
I have seen several MergeSort videos. This one is the best one to explain MergeSort algorithm.
@shlokisthebest
@shlokisthebest 7 жыл бұрын
papa ko pranam _/\_.,, arey!!!
@keshavsharma9586
@keshavsharma9586 7 жыл бұрын
pranam bhai:P
@himanshu6489
@himanshu6489 6 жыл бұрын
pranam beta
@human-011
@human-011 5 жыл бұрын
anybody in watching in 2018
@RajK-nx8cf
@RajK-nx8cf 5 жыл бұрын
even at 2118 also , this video (myCodeSchool) will stands outs of others
@jacksonxie7579
@jacksonxie7579 9 жыл бұрын
BEST sort algorithm SERIES in KZfaq!
@bakanndy
@bakanndy 6 жыл бұрын
Brilliant and detailed explanation of the algorithm. This is the best one I've seen so far.
@limwenming
@limwenming 10 жыл бұрын
Thank you! The last few minutes of the video were very helpful in helping me understand how a recursive algorithms flow. Thumbs up
Analysis of Merge sort algorithm
18:21
mycodeschool
Рет қаралды 541 М.
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 7 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 4,4 МЛН
Learn Merge Sort in 13 minutes 🔪
13:45
Bro Code
Рет қаралды 264 М.
Insertion sort algorithm
14:15
mycodeschool
Рет қаралды 1,5 МЛН
Quicksort algorithm
20:39
mycodeschool
Рет қаралды 1,8 МЛН
Why Is Merge Sort O(n * log(n))? The Really Really Long Answer.
36:50
Back To Back SWE
Рет қаралды 113 М.
Selection sort algorithm
10:18
mycodeschool
Рет қаралды 1,2 МЛН
Merge Sort Algorithm in Java - Full Tutorial with Source
23:02
Coding with John
Рет қаралды 169 М.
Merge sort example | Design & Algorithms | Lec-16 | Bhanu Priya
6:27
10 Sorting Algorithms Easily Explained
10:48
Coding with Lewis
Рет қаралды 35 М.
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 7 МЛН