Why Is Merge Sort O(n * log(n))? The Really Really Long Answer.

  Рет қаралды 115,230

Back To Back SWE

Back To Back SWE

Күн бұрын

Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe....
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
Question: Analyze the total work that Merge Sort performs as an exact function of n, the length of the input list.
My Old MergeSort Video: • Merge Sort - A Step By...
The Infinite Series 1 + 2 + 4 + 8 + ... : en.wikipedia.o...
Logarithm Rules: www.chilimath....
++++++++++++++++++++++++++++++++++++++++++++++++++
HackerRank: / @hackerrankofficial
Tuschar Roy: / tusharroy2525
GeeksForGeeks: / @geeksforgeeksvideos
Jarvis Johnson: / vsympathyv
Success In Tech: / @successintech

Пікірлер: 417
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Table of Contents (If you watch this all, you will know why Merge Sort is upper bounded by O(n * log(n))) What This Video Will Cover 0:00 - 0:40 The Fundamental Subroutines 0:40 - 1:32 The Split Subroutine 1:32 - 8:35 The Split Subroutine In Code 8:35 - 11:05 [ Old Clip ] Merge Sort Execution Trace 11:05 - 14:38 The Merge Subroutine 14:38 - 16:54 The Recurrence Relation 16:54 - 21:45 Investigation: What Work Is Done Per Level? 21:45 - 27:10 Getting Exact: Solving For Total Work Across All Levels 27:10 - 30:50 My Whole Life Has Been A Lie 30:50 - 34:51 Checking Our Work 34:51 - 35:48 Wrap Up 35:48 - 36:30 The code for Merge Sort is in the description, fully commented for understanding.
@fpv_am
@fpv_am 5 жыл бұрын
I've really applause you when I understand something from your explanation)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@mostafaomar5309
@mostafaomar5309 4 жыл бұрын
@@BackToBackSWE Hi, you're doing a really good job, thank you, but I couldn't find any code in the description? :)
@hil449
@hil449 2 жыл бұрын
you really should think about becoming a university professor if you enjoy teaching man. Your teaching methods are superb
@34521ful
@34521ful 5 жыл бұрын
The patience you had to go through every literal step, god damn, much appreciated (once again) man.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
This video is way too long and discourages clicks from passive users but whatever. It needs to be in detail since brevity would confuse and glaze over critical building blocks to the larger understanding.
@ramondelarosa4895
@ramondelarosa4895 4 жыл бұрын
@@BackToBackSWE You really are a true MVP! Your videos on time complexity algorithms are a godsend! Cheers again! Keep up the good work!!
@Ghareonn
@Ghareonn 4 жыл бұрын
Bro, you should be the one teaching me algorithms instead of my college professor, good job!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey
@name-np4gr
@name-np4gr 2 жыл бұрын
i dont get it. wtf u learning this in college for?? you shoulda learned this in high school
@cowcabobizle
@cowcabobizle 2 жыл бұрын
Well, he is.
@MohammadAbrar-tx3fc
@MohammadAbrar-tx3fc 7 ай бұрын
Phase of education varies across the globe
@paukatable
@paukatable 4 жыл бұрын
How COME a person can be this talented at teaching? Thank you a million times!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
im just so average that I had to learn harder than other lol
@Rhunyc
@Rhunyc 4 жыл бұрын
Hey man, just wanted to add a +1 to the supportive comments. I absolutely love how you do not jump over steps assuming people know what's happening. I have a brain that needs to know why every step is included even if some might find it common sense, so this is wonderful for me. I subscribed to you because I think you deserve it. :) Have a wonderful day!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Nice, welcome to the 💩show
@supastar25
@supastar25 4 жыл бұрын
He explains it so clearly on every step..subscribed
@tomevans2417
@tomevans2417 4 жыл бұрын
In my 4 years of doing a Computer Science degree I never had a lecturer explain it this well
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@minus-infinity
@minus-infinity Жыл бұрын
thats why our youtuber bros are here 😜😜 they must have gone through same problems
@Egrodo1
@Egrodo1 5 жыл бұрын
Also found your videos through Leetcode. As someone without a traditional CS background, you have a talent for explaining things in a very clear way. I imagine making these videos must be exhausting, but I do hope you continue. Even if that means one per month :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thanks and nah...we are going all the way this year.
@cristian-razvanpopa7101
@cristian-razvanpopa7101 2 жыл бұрын
For those getting stuck at [29:09], there is a 2^i before the parenthesis, but it might not be visible due to board reflections. Thank you for the video as it helped a lot to understand how its complexity is calculated for the first time.
@anthonylee1309
@anthonylee1309 5 жыл бұрын
Coming from a non-computer science major, real understanding sorting part was always a real pain. (Even with my experience in working as a sw developer). Just after watching this video for about 5 mins, lightening struck my head. I've paid more than a few hundred bucks on algorithm + data structure courses, and was never satisfied once. Your explanation, though it is free, is by far the best, and the only one I was completely satisfied with. No, it's not just satisfaction, but the best I have ever encountered in my life. Thank you once again. Truly appreciate your great work.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hahahaha thanks, I am but a boy
@adrijasamanta7949
@adrijasamanta7949 3 жыл бұрын
You have just converted a process of time complexity of O(n ^ 1000000) to O(log n) in this video with your awesome teaching talent. Really like the way you teach with immense patience and dedication.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thx
@dragoslavmilutinovic5731
@dragoslavmilutinovic5731 4 жыл бұрын
You are literally only youtuber who gives deep intuition behind this concept, you are giving us feeling like we could invent this by own, much respecttttt
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@thestudycoven8771
@thestudycoven8771 4 жыл бұрын
^ THIS is how to teach The way most professors teach is as if they are giving a refresher of something the students have already learned rigorously. They should watch this video and take notes on how to teach.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ty
@starbloods0013
@starbloods0013 4 жыл бұрын
literally the best explanation i've ever gotten. i finally get it. i go to a top university but i regret wasting my money when your videos teach me better than my professors
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nah, a college education is valuable srs. Program and build in ur own time. School itself sucks sucks sucks, but the output you get molds your mind into a critical thinking machine sorta...hard to explain.
@starbloods0013
@starbloods0013 4 жыл бұрын
@@BackToBackSWE gotchu. i'll take your word for it. thanks for the help and i hope ya'll keep making videos
@domyi6953
@domyi6953 5 жыл бұрын
I found this channel through your comment in LeetCode, and I'm so glad I was able to find your channel before my tech interview. THANK YOU SO MUCH. KEEP IT GOING
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
I'm getting tired to be honest. So much effort, 4-6 hours a day. But, I'll keep going.
@hegyilevente221
@hegyilevente221 4 жыл бұрын
You are a legend in teaching. Pure and simple explanation with a very patient attitude. It's clear that you don't do the videos to be done, you really want to transfer your knowledge, and you do it the best. I'm happy that i find you. Keep up the good work brother!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye, may the internet flourish
@heathledger7291
@heathledger7291 4 жыл бұрын
this is the stuff i was trying to find about mergesort, not just the how, but also the why, everyone else seems to think teaching splitting and merging functions is enough, but until u realize how the process is unfolding practically u never truely "realize" the essense of mergesort. The thing with recursive algorithms is that they seem very easy and obvious ,until u start thinking how the computer actually handles all the states,calls,order of calls,variables etc, thats probably why everyone tries to talk about recursion on a superficial level. This video is so great btw .Very in-depth.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yeah and thanks
@vanducnguyen346
@vanducnguyen346 4 жыл бұрын
You need way more recognition man As a person who do programming, i always curios about the concrete math model behind what is commonly told I literally watch your video to find out how exactly the time complexity got deduced And man it was a damn good video Keep it up man We do need more curiosity people like you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye, let's go to 100k
@nullbrain8552
@nullbrain8552 4 жыл бұрын
I find this to be incredibly valuable during a term where the only contact I get with my teachers is through zoom. I managed to get through my first computer science classes online with little to no issues but now that I am taking data structures I am finding that my assignments are taking 15+ hours and I think this is because of not getting to have those one on ones with my teacher. The way you have put together these videos has answered many questions that I didn't even know that I had. Thank you!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great to hear.
@karthikrockrr
@karthikrockrr 4 жыл бұрын
This material is gold and it gives you an order of solving leetcode problems to understand merge sort in dept. Kudos to the creator !
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
creator thanks u
@tinnguyen199
@tinnguyen199 7 күн бұрын
I watched the whole video at night and did not even feel asleep! So interesting!Thanks for sharing the knowledge😄
@sapokee2830
@sapokee2830 Жыл бұрын
This man is an absolute gold mine. Thank you so much, this is the clearest explanation of _anything_ I have ever seen.
@BackToBackSWE
@BackToBackSWE Жыл бұрын
Thank you, appreciate it 😄 Also check out our Free 5 Day DSA Interview Prep Mini-Course - backtobackswe.com/ 🎉
@akshitarora470
@akshitarora470 4 жыл бұрын
This is the best analysis out there, you leave me in awe with your explanations time and again. Really waiting for new videos! This was the only one I had left by mistake, sad that there's no fresh content coming from you on youtube. Anyways, thanks a ton for all that you are providing to the community!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great and thanks. and I'm spending most of my time building backtobackswe.com code-wise and building our content team. and sure - that's my goal
@yarashamali8061
@yarashamali8061 3 жыл бұрын
i mean WOW ! i was honestly struggling with my algorithm class this semester especially since its on zoom and the professor is all over the place and nothing made sense !!!!! but in just 36 minutes i understood what my professor tried to teach in 4 hours !!!!! so thank you so much ure a life saver ! would love to donate
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure thx
@tejshenanigans8070
@tejshenanigans8070 4 жыл бұрын
why aren't your videos not mostly watched ? This explanation is strongly etched into my mind .Even if forget in future how did it get that time complexity ,you gave me confidence to derive the whole process .Thank you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
They are too long to go mainstream
@charlieminaya3534
@charlieminaya3534 3 жыл бұрын
The. Best. Explanation. Ever. I have months confused about what it actually meant for it to be nlogn, and it all makes so so much sense now. Thank you a million times. Your videos are THE best. Much appreciated.
@bulioh
@bulioh 3 жыл бұрын
You have taken the amount of time for me to understand merge sort from O(n!) to O(n*log(n)), thank you
@hrithikjaysingpure9623
@hrithikjaysingpure9623 3 жыл бұрын
This is the best explanation of the merge sort on youtube.
@LenCedeno
@LenCedeno 2 жыл бұрын
First time I ever saw ANYBODY even attempt to explain how we arrive at log n or n log n or all these math conclusions. And I mean even in texts supposedly written to help you understand algorithms. Most times the lecturers/writers just rush to the final result. Way to go brother!!
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thanks buddy! do try the 5 day free mini course or subscribe to our courses with 30% discount for some exclusive content b2bswe.co/3HhvIlV
@dawn_connor
@dawn_connor 3 жыл бұрын
i'm graduated from uni, but my data structures and algorithms professor sucked. this section of CS has been the bane of my existence for a long time now, and i've really appreciated this video. thanks so much. i needed a long explanation like this.
@amypellegrini1732
@amypellegrini1732 3 жыл бұрын
I've seen (and read) lots of explanations with complexity analysis of merge sort, but this is the one that clicked for me! Thanks for this wonderful explanation.
@phenipatel7089
@phenipatel7089 5 жыл бұрын
Thank you so much, I've never understood the analysis of Sorting Algorithms correctly but you gave a remarkable explanation on all my doubts on it.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks, nice
@ellenahpage8914
@ellenahpage8914 3 жыл бұрын
I love how you broke this down to the fundamentals. So helpful, I smashed the subscribe button so hard my clicker nearly exploded
@antongrau7963
@antongrau7963 3 жыл бұрын
Thanks for you explanations. I am a student from germany. The content was also described in the script of my studies but your way to fill up this content with energy and a impressive way of didactics let me understand the topic. You have a sensitiv way to teach.
@nolanhellen4888
@nolanhellen4888 2 жыл бұрын
Holy Molly, you rocks, this is the best explanation for a student, which I can find on the internet!
@JujutsuMan
@JujutsuMan Жыл бұрын
I got to say that you are super AMAZING!!! My professor just skipped the total process.... like T(8)=T(n/2)+T(n/2)+(n-1) then bombed Worst case O(nlogn) You completely fill out all my gap about why that is O(nlogn)
@langwen8685
@langwen8685 4 жыл бұрын
Really appreciate your patience and clear presentation. I understand why it's O(nlog n) after watching this video. In addition, I really love your clear pronunciation! Really really appreciate cus you do better than my college professor!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Sure
@BornYooper
@BornYooper 5 жыл бұрын
You have a great talent for explaining these concepts. I wish this content would have been available last year when I was taking my algorithms class!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha thanks
@hiteshnagothu887
@hiteshnagothu887 4 жыл бұрын
Fantastic job !! Have we ignored the time or amount of work required to split each array until the base array arrives?? Let's say if a million items are given as input, does the amount of time to split until base has any significant effect on total running time asymptotically?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
We did do an asymptotic analysis
@scodz2007
@scodz2007 4 жыл бұрын
Terrific work, hats off to your way of explanation. I follow tons of youtuber. Nobody isn't close to your explanation approach or skill. Keep up the awesome work!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@tsilikitrikis
@tsilikitrikis 3 жыл бұрын
Hi guys, took me some time to understand at the end how the nlogn was extracted by the Σn. its very simple, because 'i' is not there in the sum(Σn) you Just adding n, logn times(logn=times you split the problem or levels). So here the serie has 3 terms but he start to count from 0 to logn - 1, so he has logn sums of n, or n + n +n =3*n=log(8)*n =n*logn im new to CS and try to Learn algorithms, great video man thank you very much!!
@יעלליפשיץ-ס6ש
@יעלליפשיץ-ס6ש 4 жыл бұрын
you are amazing!! I'm planning to watch all your videos about sorts!!! Thank you so much for making this video. I can see the amount of effort that was put in to it!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great and thx
@alan0428a
@alan0428a 3 жыл бұрын
I finally know why the time complexity of merge sort is nlog(n) now.....Thanks a lot!
@Owen7768
@Owen7768 2 жыл бұрын
After a couple of days and a lot of videos, finally I found a video that really help to understand the time complexity of merge sort. thank you !
@PenStab
@PenStab 3 жыл бұрын
My god, this is fantastic. I have ADHD but you present this in such a thorough and interesting way, it's not problem paying attention. Thanks so much!
@КрасавчикИкиса
@КрасавчикИкиса 3 жыл бұрын
I thought I'd skip it once I feel lost, but it never happened, great job. Wish u more subscribers
@yannaleyva4554
@yannaleyva4554 5 жыл бұрын
I think I love you.... Or at least your explanations and fantastic teaching skills xD Please keep up the fantastic work. Very high-quality and helpful, unlike most resources I have looked at previously! I also appreciate you including the table of comments with the times. Subscribed :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Table of Contents is critical. Thanks.
@truthseeker8767
@truthseeker8767 4 жыл бұрын
No one: Lecturers(not everyone): Me: This is how to put your effort in exemplifying down to the basics for the sake of learning!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks ahah
@ekejma
@ekejma 3 жыл бұрын
Doing the math here was one of the high points of my review of computer science. One of the best videos because of the deeper understanding that is so effectively presented.
@KuldeepYadav-jw7jn
@KuldeepYadav-jw7jn 4 жыл бұрын
No other video on the internet can describe this any better, huge respect for you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@tomaustin9166
@tomaustin9166 7 ай бұрын
A true masterpiece of a video and a true masterpiece of a man. You are such a good teacher and I'm glad I can learn my University course of you! :)
@GabrielPerez-ml2go
@GabrielPerez-ml2go 4 жыл бұрын
bro, yore easily better than all my college teachers at explaining this, hell yeah im subscribing
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
welcome
@anmjubaer
@anmjubaer 4 жыл бұрын
Superb video. A huge effort. Thanks. Btw, can you do Master theorem? I find it a bit confusing.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx and yeah
@Ian-bb7vv
@Ian-bb7vv 6 ай бұрын
thank you for this. what you are doing is really helping people. i think you know that, but still want to help confirm your work. thank you
@gabrielesimoncini1121
@gabrielesimoncini1121 Жыл бұрын
I understood why Merge Sort is O(n log n) in this way, and I want to ask if this reasoning is correct. You can think of the O(n log n ) in a different way. In fact, on each level (0,1,2) where the list is divided into 4s, 2s and 1s, when we do the merge step, we compare EACH number of the level, first in the left side and then (when we are done with the left side of all levels) on the right side of the level. So at the end of the day all numbers of all levels will be merged; so the logic is: For each level all the n numbers are merged The number of levels is obviously log(n), so we have to merge log(n) multiplied by n numbers. obviously, in the merge sort we merge first the left side and then the right side, but this is the same as merging all numbers of the same level log(n) times. Is it correct?
@theappgirl6615
@theappgirl6615 4 жыл бұрын
This is sooo informative. I finally understood Merge Sort and most importantly, why it has O(NlogN) time complexity. thank you so much ! :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@haoruikun1191
@haoruikun1191 Жыл бұрын
My ivy-league college professor couldn't help me truly comprehend this time complexity, but you did it. I hope they fire that professor and hire you instead.
@BackToBackSWE
@BackToBackSWE Жыл бұрын
haha thanks, means a lot. Would love some feedback on other content - backtobackswe.com/
@wsaylazer
@wsaylazer 2 жыл бұрын
This is literally by far the best explanation I have ever seen. Good going!
@sameerarasanga8975
@sameerarasanga8975 2 жыл бұрын
To the point well explained, couldn,,,'t imagine how 36 min goes so quickly
@vrashankraom
@vrashankraom 4 жыл бұрын
Awesome bro! I have never seen such a good explanation ever!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks and thanks
@frankgarcia6673
@frankgarcia6673 4 жыл бұрын
If I could like this video 10000 times, I would.. Thank you so much for the clear explanation !
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Create a server farm and do it
@vishnupriya47659
@vishnupriya47659 5 ай бұрын
That's the best explanation for any beginner to understand.
@ARATHI2000
@ARATHI2000 Жыл бұрын
Great job. Appreciate the Big-O complexity details!
@zelda8697
@zelda8697 Жыл бұрын
i would say you still need to watch few other videos to understand the concept of merge sort and the code as well, however he did great job explaining some concepts in this video, its amazingly helpful
@BackToBackSWE
@BackToBackSWE Жыл бұрын
thanks :)
@DivinityinLove
@DivinityinLove Жыл бұрын
Great explanation. I got lost towards the last 6 minutes once the distribution started and couldn't follow anything after we arrived at n log n. :/ But will return to watch again :) great break down. Thanks.
@dishagupta7446
@dishagupta7446 3 жыл бұрын
I always had tough time understanding time complexities but now it's all clear after watching your videos❤️
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great
@mia-so4ry
@mia-so4ry 2 жыл бұрын
this was amazing, thank you so much. This video made me fall even deeply in love with CS and math!!
@jigarsingh600
@jigarsingh600 4 жыл бұрын
This forest explanation is the best recursion call stack explanation of an algorithm on internet!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks lol
@rishabh55
@rishabh55 5 жыл бұрын
So much effort in a video for merge sort
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Very much so
@josephcohen734
@josephcohen734 3 жыл бұрын
Each sentence was a little incoherent individually, but as a whole this was a pretty clear explanation. Definitely cleared it up for me.
@suyuan9158
@suyuan9158 4 жыл бұрын
So clear, bro! Wonderful job, cannot wait to subscribe!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey
@serogozin
@serogozin 2 жыл бұрын
Thank you for your videos, they helped me a lot for my DSA exam
@Me0w_Meaw
@Me0w_Meaw Ай бұрын
Hello guys , a little bit of help required, But first I would like to thank the genius for explaining this video at another level. I have came to learn a lot of things which I didn't even know. Doubt 1: I lost it at 22:10. one subproblem*(n-1)compsrisons. Why are we multiplying 1*(n-1) or 2(n/2-1) or so on... I am trying to match the sequence with this formula T(n) = 2T(n/2) + (n-1). But I can't find the pattern. Doubt 2: 30:10 The summation formula stands for (upper bound - lower bound) but he was adding extra +1 at the end. He did mention something about the bounds, but unfortunatly I did not get it which bonds he was talking about. Also 30:30 he multiplied n with the factor ( logn-1-0+1). Can anyone explain this to me ? please?
@Onelegtrev
@Onelegtrev 4 жыл бұрын
I feel that my brain has expanded 10 fold by watching your video. Thank you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@willianfn
@willianfn Жыл бұрын
Thank you, it was so didactic. I loved your explanation and could really understand what was going on.
@hiimgosu3174
@hiimgosu3174 3 жыл бұрын
Hi there, I have a question. I totally understand the complete mathematical way of getting the nlogn-n+1. However, for the T(n)=2T(n/2)+(n-1), this (n-1) means n-1 "comparison", but T(n) means total time used at this level. these 2 items have different unit, should we multiply (n-1) with a constant which stands for time cost of each comparison? Kindly help clarify. Thank you sir
@nniazoff
@nniazoff 5 жыл бұрын
Very clear and detailed. Great job.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thx
@ryancodrai487
@ryancodrai487 3 жыл бұрын
I thought your explanation of the big o complexity was superb. I really liked you worked through the proof and then did the mathematical proof and showed that using the formula got the right answer. Definitely pushed my understanding further there.
@AhmedMostafa-so2jp
@AhmedMostafa-so2jp 3 жыл бұрын
this is the best explaination ever to anything!!
@danrussell1057
@danrussell1057 3 жыл бұрын
You've taken something that twisted my head to epiphany. Thank you so much!
@bulioh
@bulioh 3 жыл бұрын
I didn't see this directly linked in your description, but this explains the derivation of the geometric series formula: en.wikipedia.org/wiki/Geometric_progression
@coolio_catio
@coolio_catio 3 жыл бұрын
This was so so helpful, thank you so much for putting in all the work required to make this video
@janewu4660
@janewu4660 2 жыл бұрын
Thank you so much for your detailed explanation!! It really helps a lot!!!!
@varunkhanna8919
@varunkhanna8919 4 жыл бұрын
Is there an optimal sequence using which I can watch all the videos you've put up?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Just watch videos you are weak on We have a more category-based ordering on backtobackswe.com (paywall though)
@MubashirAR
@MubashirAR 4 жыл бұрын
This channel is a goldmine 👌 Superb explanation
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@TripedalTroductions
@TripedalTroductions 4 жыл бұрын
This is nitpicking but according to the ISO 31-11 standard, log base 2 denoted as lb(x) for binary logarithm, where as log base 10 is lg(x), but log(x) is not defined in the standard. Personally I hate it. Why wouldn't log(x) be log base 10 and lg(x) be the binary logarithm? This is madness. Great video by the way. This is the videos I go to by default now cause the quick and dirty pretty visuals from other channels just don't cut it for me.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
fascinating
@zettbk
@zettbk 4 жыл бұрын
Just wow! This is a brilliant piece of material!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@shelby1999
@shelby1999 2 жыл бұрын
Understanding this concept finally in my 1000th video.
@abysir4461
@abysir4461 4 жыл бұрын
I am watching this in LockDown...... Awesome Explanation.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@shishirpai380
@shishirpai380 Жыл бұрын
Everything makes perfect sense now! Thank you
@canernm
@canernm 4 жыл бұрын
Thanks for the video. At 28:00 you say that base cases contribute 0 comparisons, however when you have two 1-element lists (base case) you still compare these 2 elements to find which is smaller so you can merge them into a 2-element list. Am I wrong ? Thanks in advance.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
The base case is just an if statement that returns. You are talking about the merge right above the base cases I think
@canernm
@canernm 4 жыл бұрын
@@BackToBackSWE Thanks for reply. Yeah I figured it out, its just that in my mind I calculated the work done starting from one level below the one you did haha. But yeah total work level is the same, thank you.
@craxl2287
@craxl2287 4 жыл бұрын
Hi, I am working on my Math IA (research project for IB HL Mathematics) for my High School Math course. For my project, I am trying to understand why Merge Sort has a big O notation of O(nlogn). Your video makes a lot of sense and really helped me understand most of the complicated concepts. Even still I am just a tad confused at time 28:10. You said Log(8)=3 but does that not assume that the base for the log is 2? Did I miss something in the video where you specified this? Also should the big O notation actually by O(nlog(base 2)(n)) and is instead simplified to just O(nlogn)?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
"You said Log(8)=3 but does that not assume that the base for the log is 2?" Yes. "Also should the big O notation actually by O(nlog(base 2)(n)) and is instead simplified to just O(nlogn)?" The base of the log does not matter since it is asymptotic. You can intellectually understand this, but you can take the actual limit to see this is the case (I forgot the math behind it, been 1 year since we did this in algos).
@alex-gz7ud
@alex-gz7ud 3 жыл бұрын
YOU ARE AMAZING!!!!! Thank you for making this video!!!!
@zavierjack4709
@zavierjack4709 5 жыл бұрын
Brah. I've owned text books that don't go into this much detail. This whole thing is SO appreciated
@zavierjack4709
@zavierjack4709 5 жыл бұрын
24:30 🔥🔥🔥🔥🔥
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@NagarajaT
@NagarajaT 2 жыл бұрын
Excellent explanation I've even seen in a long time
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@tibzblaze1708
@tibzblaze1708 3 жыл бұрын
So the number of comparisons to get from level 1 to level 2 would be 2(N/2 - 1) right?
@Youssiflagrosse
@Youssiflagrosse 3 жыл бұрын
I always wanted to know where this came from. Awesome way to teach. Great job.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
Glad it was helpful!
@insanebhuvi3726
@insanebhuvi3726 3 жыл бұрын
Give an example input list that requires merge- sort and heap-sort to take O(nlog n) time to sort ,but insertion -sort runs in O(n) time. What if you reverse this list I want the python code for this question can u please try ???
@saikiran-xh5lt
@saikiran-xh5lt 3 жыл бұрын
I really appreciate your efforts, thanks, bro.
@theManTheGuy_inTheMiddle
@theManTheGuy_inTheMiddle Жыл бұрын
I'm very thankful past this video. Thank u. Hello from Brasil!!
@BackToBackSWE
@BackToBackSWE Жыл бұрын
Glad it helped😄 Also check out our FREE DSA Interview Prep Mini-Course - backtobackswe.com/ 🎉
@blatogh1277
@blatogh1277 3 жыл бұрын
That is the hardcore explanation of O(logn).
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
Поветкин заставил себя уважать!
01:00
МИНУС БАЛЛ
Рет қаралды 6 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 986 М.
Merge Sort Algorithm in Java - Full Tutorial with Source
23:02
Coding with John
Рет қаралды 178 М.
Getting Sorted & Big O Notation - Computerphile
10:59
Computerphile
Рет қаралды 317 М.
The Quicksort Sorting Algorithm: Pick A Pivot, Partition, & Recurse
26:31
Back To Back SWE
Рет қаралды 164 М.
Why this puzzle is impossible
19:37
3Blue1Brown
Рет қаралды 3,1 МЛН
Lecture 3: Insertion Sort, Merge Sort
51:20
MIT OpenCourseWare
Рет қаралды 835 М.
Why Comparison Based Sorting Algorithms Are Ω(n*lg(n))
17:10
Back To Back SWE
Рет қаралды 62 М.
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17