inspiration recording at 3 am when he can create content with so much dedication then why can't we learn dsa with same dedication hats off to you man.💯💯
just woke up and started doing dsa, and you are recording it at midnight, your efforts are not wasted at all Sir!! Thank you for providing such quality content for free.
same brother.............i was watching the video suddenly at last striver said it's 3.30am and i just felt sham on my self boz he is teaching till night and i don't learn genuinely..
In 4 years of college, when teachers came to copy and paste from their 10year old notes I couldn't gain any interest in DSA and felt stupid and never touched the topic post exam. And everything instantly clicked when I watched this video. Honestly your course is giving me insane confidence already. Hope I can make a change within a year, though it's difficult after doing full-time job but I get my confidence back when i see you making this huge stuff after working same or more hours. Planning to stay consistent! Thanks a lot! PS: We have the same chair 😁
In my 4 years of engineering and 7 years of work experience, I finally understood merge sort with recursion. I can finally move ahead and sleep properly😂 Thank you so much. Really appreciated 🙏🙏🙏 Love you bro ❤
Superb explanation, sat for around 4hrs to understand how merge sort is working and then I found this video. Understood clearly within 50mins. Very nice and deep explanation.
It's 3:34 in the AM right now and I'm absolutely loving your videos and implementing them simultaneously! I can't ever thank you enough for the amazing content that you've put out! I have my placement drive starting in approximately 100 days and plan to make the most out of it with the help of your lessons! Dil se thank you bhai! Will update my placement status soon!
The efforts taken to make this video must have been insane, because this was frankly explained so well it's honestly brilliant. Thank you for all your efforts. Completing this at 4:47am here.
int mid =(low + high) / 2; might give an integer over flow resulting in a negative index which would throw Array out of Bounds Exception and hence its a good practice to use int mid = low + ((high - low) / 2); or faster way is int mid = (low + high) >>> 1 (For Java) and int mid = ((unsigned int)low + (unsigned int)high)) >> 1 (For CPP) to avoid any kind of overflows..
From all the TH-cam tutorials, I definitely think that your videos are the best in terms of explanation and easy understanding. Thanks a lot, and please keep it up, I love the content!!!!!
These is the best explanation I have find in my entire dsa life. The best part that I always found in other dsa lectures is the best dry run and how to convert that explanation in code. ALOT OF THANKS. And that Time and Space Complexity part is like "Add a feather in a cap"
A little correction at 24:37 You can't write if(low>=high). It will cross the time limit in some cases. As I'm facing this issue in GFG merge sort problem. Instead use if(low==high)
@Raj you are changing the field of programming even the concepts and the visualization which are difficult for the experienced professional by watching your videos feel like it's just a cakewalk. Thanks for the content, keep doing it. JAVA CODE for the merge Sort Algorithm----- TC--O(n*logn) & SC--O(n) import java.util.*; public class Solution { public static void mergeSort(int[] arr, int n) { // Write your code here. ms(arr,0,n-1); } public static void ms(int arr[],int low,int high) { if(low>=high) { return; } int mid = (low+high)/2; ms(arr, low, mid); ms(arr, mid+1, high); merge(arr,low,mid,high); } public static void merge(int arr[],int low,int mid,int high) { int left = low; int right = mid+1; java.util.List temp = new ArrayList(); while(left
#Free Education For All......... # Bhishma Pitamah of DSA...You could have earned in lacs by putting it as paid couses on udamey or any other elaerning portals, but you decided to make it free...it requires a greate sacrifice and a feeling of giving back to community, there might be very few peope in world who does this...."विद्या का दान ही सर्वोत्तम दान होता है" Hats Off to you man, Salute from 10+ yrs exp guy from BLR, India....
understood! When you get to quicksort please try to cover other related application like kth smallest/largest using quickselect and median in unsorted array in linear time
Amazing job explaining step by step in very detail i read lots of article and watched other TH-cam, but your explanation is owesome!!!, Thank you so much, before merge sort algorithm was very intimidating, but you made it sounds so easy. Thanks a lot again! I am glad I found your channel.
Really appreciate your work ❤❤❤ Actually i confused in this topic from last week and now i got it after watching this super lecture on merge sort Dry run is part best for understanding the concept of merge sort and thank you so much ❤️
Implementation code of Merge Sort algorithm in Java : class Solution { public static void merge(int[]nums,int low,int mid,int high){ int left=low,right=mid+1; Listli = new ArrayList(); while(left
Because this loop will be recursively called for several times and for each time, the value of low will change. If this loop would have ran only 1 time (i.e. if this loop was inside a non-recursive function), then your logic would have worked. But i am also unable to get how he came up with this logic of (i-low). He forgot to tell the intuition behind it.
Shocked to see that the time of completing the recording is 3:20 AM.. It shows your unwavering dedication.. hatsoff to you striver!! you are an inspiration. Understood the concept very well!!
for(int i = low; i < high; i++) { arr[i] = temp.get(i - low); } while copying the temp array to original array why we are subtracting low from i, can't we directly write i ?
The subtraction of low from i is necessary because temp is a smaller array that starts at index 0, whereas arr is the original array that might start at a higher index low. Here’s the breakdown: i is an index in the original array arr, which ranges from low to high - 1. temp.get(i - low) is accessing the corresponding index in the temp array, which starts from 0. If you directly use i without subtracting low, you would try to access elements from temp at an incorrect index, leading to an out-of-bounds error or incorrect copying. this is the answer given by gpt
For example if the divided array is 1,3 with index 3 and 4... after further division we get two array 1 and 3 . Now we have to sort and then merge and then store in temporary array, whose indexing starts from 0 BUT the original arrays index starts from 3 then 4... that is why we do temp[i-low] to make the index 0 for accessing the 0th element of temp...... Hope you understand.
See 5 4 3 2 1 Here it will broken as 5 4 3 and 2 1 Then 5 4 3 will be broken as 5 4 and 3 Here low will be 0 so there will be no problem we will copy temp element into the vector but for 2 1 the low I'll be 3 and there in temp vector will have elements in 0 and 1 so to copy them we subtract it will low so that we can access the temp elements at starting indexes
Raj bhaiya, you are literally phenomenal. In this era of recession, you're the sun of hope. So no more excuses just strive every single day to become better.
How i express your teaching skills You r amazing!!! I seen so many videos on merge sort but no one explain like you even my college professor I thank to myself for finding this amazing playlist.
06:13 Merge sort is an optimized sorting algorithm. 12:26 Merge Sort is about merging and sorting arrays in a hypothetical manner 18:39 Merge Sort is an algorithm that divides an array into two halves, sorts them, and then merges them. 24:52 Merge Sort Algorithm using Recursion 31:05 Understanding merge sort through pseudocode and dry run 37:18 Explaining the merge sort algorithm 43:31 Merging left and right arrays 49:43 Merge Sort has a time complexity of n*log(n) and a space complexity of n.
those who dint understand why we use i-low the reason is that low is given by user so it should not necessarily be 0 so for example if low is 2 and high is 6 so temp will have elements from 2 to 6 in sorted order so arr[low] should be temp[0] and arr[low+1] should be temp[1] and so on.so to map these we use i-low
it took me near about 4 hours to completely understand the sorting technique I am in first year of engineering an average guy hoping that ..... this stuff takes time for beginners
Wow, this DSA course is absolutely fantastic! 🚀 The explanations are clear and easy to follow, and the examples provided really helped solidify my understanding. I've been searching for a comprehensive resource like this, and I'm so glad I stumbled upon it. A huge shoutout to the creator for putting together such a valuable learning resource. Kudos! 👏💯 #DSA #TUF
I am just looking for this type of explanation but no one describes like you. At last you described it in part by part thanks a lot brother. I am a big fa of yours ❤❤
TBH This is my first comment on any study youtube channel ..and i genuinely appreciate this man's effort from bottom of my heart ..whatttaaa explanation ..straight into the head..thankss striver bhaiya 💌💌
After Watching Recursion Videos. In sorting once concept is know, i am able to write the structure with code on my own. MAy Be paper work is playing the major role. Every video is full of content with zero to hero. Its really great🚀🚀🚀🚀🚀
Once again, an outstanding video! Thank you for investing so much effort in breaking down the approach, providing clear pseudocode, illustrating with recursion trees, and finally, implementing the solution. Take good care of your health too! I hope that you are at least getting sleep for 7 to 8 hours.
The note section is missing the Python Code, Pasting it here, P.S.: The Merge function is a bit different but the concept is Same. class Solution: def merge(self,arr, l, m, r): # code here arr1 = arr[l:m] arr2 = arr[m: r+1] i = j = 0 while i < len(arr1) or j < len(arr2): if j >= len(arr2): arr[l+i+j] = arr1[i] i += 1 elif i >= len(arr1): arr[l+i+j] = arr2[j] j += 1 elif arr2[j] > arr1[i]: arr[l+i+j] = arr1[i] i += 1 else: arr[l+i+j] = arr2[j] j += 1 def mergeSort(self,arr, l, r): #code here if l==r: return mid = l + (r-l)//2 self.mergeSort(arr, l, mid) self.mergeSort(arr, mid+1, r) self.merge(arr, l, mid+1, r)
Thanks for the amazing lecture sir. I've been struggling with consistency for so long. So from now on I'll comment on everything I learn. Trying to get a strong hold of dsa before the intern season starts officially.
06:13 Merge sort is an optimized sorting algorithm. 12:26 Merge Sort is about merging and sorting arrays in a hypothetical manner 18:39 Merge Sort is an algorithm that divides an array into two halves, sorts them, and then merges them. 24:52 Merge Sort Algorithm using Recursion 31:05 Understanding merge sort through pseudocode and dry run 37:18 Explaining the merge sort algorithm 43:31 Merging left and right arrays 49:43 Merge Sort has a time complexity of n*log(n) and a space complexity of n. Crafted by Merlin AI.
Let's march ahead, and create an unmatchable DSA course! ❤
Can someone please add timestamps, I will add them post-it.
time stamps done bro
Bhai please upload videos asap..😭we from a normal tier 3 college are hoping for your videos...pls don't late
#striver pls make videos faster bhai 😭
#striver pls make videos faster bhai 😭..your content is too gud ...but our placements are going on fastly
Bhaiya please be fast in terms of uploading videos 😭😭😭
inspiration recording at 3 am when he can create content with so much dedication then why can't we learn dsa with same dedication hats off to you man.💯💯
190 + likes to this comment but no sub comments
Lemme fix it
Hare krishna
Hare krishna hare krishna krishna krishna hare hare
Hare rama hare rama rama rama hare hare
Chant this and be happy
@@random-xl3zm 😂😂 thanks dude
@@Akash-xr6we no worries
Jai siya ram😁
just woke up and started doing dsa, and you are recording it at midnight, your efforts are not wasted at all Sir!! Thank you for providing such quality content for free.
same brother.............i was watching the video suddenly at last striver said it's 3.30am and i just felt sham on my self boz he is teaching till night and i don't learn genuinely..
In 4 years of college, when teachers came to copy and paste from their 10year old notes I couldn't gain any interest in DSA and felt stupid and never touched the topic post exam. And everything instantly clicked when I watched this video. Honestly your course is giving me insane confidence already. Hope I can make a change within a year, though it's difficult after doing full-time job but I get my confidence back when i see you making this huge stuff after working same or more hours. Planning to stay consistent! Thanks a lot!
PS: We have the same chair 😁
But why i can't hear his voice
MERGE SORT - O(nlogn) - divide and conquer
1:16 - What is and Why Merge sort
3:00- Divide
5:54- Merge
Pseudo code
17:15 - approach (divide)
20:34 - pseudo code (divide)
25:00 - dry run on divide (pseudo code breakdown)
32:42 - approach (merge)
33:46 - pseudo code (merge)
40:33 - C++ code
44:10 - Time complexity analysis
48:05 - Space complexity analysis
❤
In my 4 years of engineering and 7 years of work experience, I finally understood merge sort with recursion. I can finally move ahead and sleep properly😂 Thank you so much. Really appreciated 🙏🙏🙏 Love you bro ❤
🤣
now the question is whether u r going use it or not
@@iamnoob7593 😂😂
@@iamnoob7593 🤣🤣🤣🤣🤣🤣
Superb explanation, sat for around 4hrs to understand how merge sort is working and then I found this video. Understood clearly within 50mins. Very nice and deep explanation.
The title "STRIVER" for a reason!!✅
It's 3:34 in the AM right now and I'm absolutely loving your videos and implementing them simultaneously! I can't ever thank you enough for the amazing content that you've put out! I have my placement drive starting in approximately 100 days and plan to make the most out of it with the help of your lessons! Dil se thank you bhai! Will update my placement status soon!
So, What's the status bro?
where are u working now?
bro placed?
Striver teaching how to code is just like a story. It really seems so easy to understand 😊
The efforts taken to make this video must have been insane, because this was frankly explained so well it's honestly brilliant. Thank you for all your efforts. Completing this at 4:47am here.
No compromise on sleep from my side , Body does not listen to emotions
This is called content 🤓✨
Before I use to feel merge sort very difficult but after watching this video, I understood it very clearly. Thank you Striver.
Thanks Striver, I 'understood' it perfectly! This channel has the potential to become huge with content like this.
44:2 - "I write codes in one go", the confidence i want
This level of clarity would have never been possible without ur video. Your energy of teaching any topic is what makes it more interesting. 🤟
Best merge sort ever but i little bit mad so have to watch it 2-3 times to get properly in my head btw thankyou Striver
int mid =(low + high) / 2; might give an integer over flow resulting in a negative index which would throw Array out of Bounds Exception and hence its a good practice to use int mid = low + ((high - low) / 2); or faster way is int mid = (low + high) >>> 1 (For Java) and int mid = ((unsigned int)low + (unsigned int)high)) >> 1 (For CPP) to avoid any kind of overflows..
why in the last we did arr[i] = temp[i-low] and not arr[i]=temp[i
]
@@utkarshsingh5652 Because every time the low is not zero. In deeper recursive calls, low can be anything
@@ksankethkumar7223but we added elements in temp so index might be from 0 to high??
@@utkarshsingh5652 bro did u understand i-low concept?
can you explain i-low logic please, I can't get that? low would always be 0, I don't understand the point, although not doing this, does give an error
This was the best explanation for Merge Sort on TH-cam! Thanks
Fr
best merge sort explanation on TH-cam ever I'll never forget that thanks bhaiyya!
From all the TH-cam tutorials, I definitely think that your videos are the best in terms of explanation and easy understanding. Thanks a lot, and please keep it up, I love the content!!!!!
These is the best explanation I have find in my entire dsa life. The best part that I always found in other dsa lectures is the best dry run and how to convert that explanation in code.
ALOT OF THANKS.
And that Time and Space Complexity part is like "Add a feather in a cap"
You are the real hero .. providing such a beautiful content in free of cost. thanks a lot bro.
A little correction at 24:37
You can't write if(low>=high). It will cross the time limit in some cases. As I'm facing this issue in GFG merge sort problem. Instead use if(low==high)
Ohhh!!! nice
Thanks for pointing this out, I was getting TLE due to this on Leetcode.
but why it is giving TLE ?
As expected, Striver's Top notch explanation made Merge sort crystal clear. UNDERSTOOD!! thankyou striver for all the content
Great explanation sir, i didn't understand this concept from love babbar sir so i came here and got it ❤❤❤
Understood! Super amazing explanation as always!! Thank you for your great effort even in the midnight !!!
More than 500k views for this video. Imagine the impact this guy is making in the DSA community.
I hope you realize how much value you are creating. It's much more than you think. Thanks a lot!!
I'm pausing the video in between just to appreciate you, the way you explain things is just awesome man. Keep the good work coming. God bless you.
Understood!! Best Explanation ever🙌🙌🙌🙌 #Striver Aka
@Raj you are changing the field of programming even the concepts and the visualization which are difficult for the experienced professional by watching your videos feel like it's just a cakewalk. Thanks for the content, keep doing it.
JAVA CODE for the merge Sort Algorithm----- TC--O(n*logn) & SC--O(n)
import java.util.*;
public class Solution {
public static void mergeSort(int[] arr, int n) {
// Write your code here.
ms(arr,0,n-1);
}
public static void ms(int arr[],int low,int high)
{
if(low>=high)
{
return;
}
int mid = (low+high)/2;
ms(arr, low, mid);
ms(arr, mid+1, high);
merge(arr,low,mid,high);
}
public static void merge(int arr[],int low,int mid,int high)
{
int left = low;
int right = mid+1;
java.util.List temp = new ArrayList();
while(left
just mind blowing explanation .
I wrote the code at first attempt after your explanation ..........thank you so much..
Bhaiya please make videos on oops concepts.... The only thing missing from your placement series 🥲
Yes sir please
#Free Education For All......... # Bhishma Pitamah of DSA...You could have earned in lacs by putting it as paid couses on udamey or any other elaerning portals, but you decided to make it free...it requires a greate sacrifice and a feeling of giving back to community, there might be very few peope in world who does this...."विद्या का दान ही सर्वोत्तम दान होता है" Hats Off to you man, Salute from 10+ yrs exp guy from BLR, India....
understood! When you get to quicksort please try to cover other related application like kth smallest/largest using quickselect and median in unsorted array in linear time
Amazing job explaining step by step in very detail i read lots of article and watched other TH-cam, but your explanation is owesome!!!, Thank you so much, before merge sort algorithm was very intimidating, but you made it sounds so easy. Thanks a lot again! I am glad I found your channel.
why did we use temp [ i-low ] while storing the temp values in original array
same question please answer
To make it start from 0 index ,bcz temp is storing from 0 index
Bro only ' i ' is also running...
just use arr[i]=temp[i]
Kya explain kiya hai bro !! like wtf pure yt pe itna acha explanation nai mila meko. Hats off to you my man.
The Best video avliable for Merge sort on internet . Tysm Striver Understood everything
Really appreciate your work ❤❤❤
Actually i confused in this topic from last week and now i got it after watching this super lecture on merge sort
Dry run is part best for understanding the concept of merge sort and thank you so much ❤️
Implementation code of Merge Sort algorithm in Java :
class Solution {
public static void merge(int[]nums,int low,int mid,int high){
int left=low,right=mid+1;
Listli = new ArrayList();
while(left
nums[i] = li.get(i-low);
why are we doing this?
nums[i] = li.get(i) will this not wokr?
Wow didn't know this was a 50 minute video!! Never made me look at the time ❤❤❤ this is the best video on merge sort❤ thank you very much 😄
@39:52 why can we write temp[i] directly instead of i-low when it only depends on the value of i
same problem bro ,i cant understand it from past 3 days
Same question 💀💀
Because this loop will be recursively called for several times and for each time, the value of low will change. If this loop would have ran only 1 time (i.e. if this loop was inside a non-recursive function), then your logic would have worked.
But i am also unable to get how he came up with this logic of (i-low). He forgot to tell the intuition behind it.
@@rohandhalpe9084bro did you understand it now, please help...
Thank you so much for the amazing explanation🙏.I understood the algorithm perfectly only because of this video.
Striver audio got muted please check it
Shocked to see that the time of completing the recording is 3:20 AM.. It shows your unwavering dedication.. hatsoff to you striver!! you are an inspiration. Understood the concept very well!!
#striver best merge sort video i ever watched. It clears my all doubt points
11:44 I've studied this algorithm several times, but the clarity I gained from Striver Bhaiya is unmatched. Thank you sincerely, Bhaiya. ❤
at 43:49 line number 28 why arr[i]=temp[i-low] ; why (i-low)? why cant we write simply i itself ??
same doubt
The best explanation on merge sort! I had a confusion while backtracking, which has been sorted out now.
Please make the videos faster...sir please please please....very less time is there for our placements.....my humble request sir😭😭😭😭😭🙏🙏🙏🙏🙏🙏🙏🙏🙏
You don't understand if he makes videos faster. Just watch the video in 2x speed
Great lecture. Slightly different implementation of mergeSort in python.
def merge(a1,a2):
res = []
l,r = 0,0
while(l
for(int i = low; i < high; i++) {
arr[i] = temp.get(i - low);
}
while copying the temp array to original array why we are subtracting low from i, can't we directly write i ?
did you got the answer?
The subtraction of low from i is necessary because temp is a smaller array that starts at index 0, whereas arr is the original array that might start at a higher index low.
Here’s the breakdown:
i is an index in the original array arr, which ranges from low to high - 1.
temp.get(i - low) is accessing the corresponding index in the temp array, which starts from 0.
If you directly use i without subtracting low, you would try to access elements from temp at an incorrect index, leading to an out-of-bounds error or incorrect copying. this is the answer given by gpt
great explanation not one other video on TH-cam is as in-depth for the actual understanding of how it works
Will you keep next video or not??.. 14days it's been
how is bro so good at explaining, smb give this man an award
why use temp[i=low] and not temp[i] .
For example if the divided array is 1,3 with index 3 and 4... after further division we get two array 1 and 3 . Now we have to sort and then merge and then store in temporary array, whose indexing starts from 0 BUT the original arrays index starts from 3 then 4... that is why we do temp[i-low] to make the index 0 for accessing the 0th element of temp......
Hope you understand.
Bro thank you for all the HARDWORK you've done to make this so easy for us. T_T
Why are we doing
𝗮𝗿𝗿[ 𝗶 ] = 𝘁𝗲𝗺𝗽[ 𝗶 - 𝗹𝗼𝘄 ] Instead of
𝗮𝗿𝗿[ 𝗶 ] = 𝘁𝗲𝗺𝗽[ 𝗶 ]
if u found explanation please explain
See 5 4 3 2 1
Here it will broken as 5 4 3 and 2 1
Then 5 4 3 will be broken as 5 4 and 3
Here low will be 0 so there will be no problem we will copy temp element into the vector but for 2 1 the low I'll be 3 and there in temp vector will have elements in 0 and 1 so to copy them we subtract it will low so that we can access the temp elements at starting indexes
because the starting value of i is "low" and we need to start from zero in temp i.e, temp[0]
your explanation method is awesome as compare to other .
I saw many video in merge sort but I understand only in this video.
thank you sir❤❤🔥🔥👍
#striver pls make videos faster bhai 😭
kuch kuch aata tha lekin video dekh ke accha se ho gya sab clear... Thanks, bhaiya!!!😊
Omg 16days per 1video..omg 😱😳 bro..pls think of us..we here are waiting for your videos faster and eager #striver..i think you are consistent 😓😓😓
What an explainaiton.lIterally Hats off striver..KEEP CREATING KEEP MOTIVATING
Raj bhaiya, you are literally phenomenal. In this era of recession, you're the sun of hope. So no more excuses just strive every single day to become better.
Hats off to you man, great explanation. I didnt get this type of explanation for this algorithm all over th youtube, specially the dry run.
Before starting this dsa course ,i felt merge sort is very difficult but striver explained it very clearly ..Thank you Striver 😍
Thankyou for explaining this very tough algo in a very simple way , now it's just get locked in my mind , all credit goes to you !! Thanks a lot !
One of the best explanations I have ever seen on TH-cam 🛐
Probably the best video available on Merge Sort Ever. Goated.
How i express your teaching skills
You r amazing!!!
I seen so many videos on merge sort but no one explain like you even my college professor
I thank to myself for finding this amazing playlist.
06:13 Merge sort is an optimized sorting algorithm.
12:26 Merge Sort is about merging and sorting arrays in a hypothetical manner
18:39 Merge Sort is an algorithm that divides an array into two halves, sorts them, and then merges them.
24:52 Merge Sort Algorithm using Recursion
31:05 Understanding merge sort through pseudocode and dry run
37:18 Explaining the merge sort algorithm
43:31 Merging left and right arrays
49:43 Merge Sort has a time complexity of n*log(n) and a space complexity of n.
those who dint understand why we use i-low the reason is that low is given by user so it should not necessarily be 0 so for example if low is 2 and high is 6 so temp will have elements from 2 to 6 in sorted order so arr[low] should be temp[0] and arr[low+1] should be temp[1] and so on.so to map these we use i-low
it took me near about 4 hours to completely understand the sorting technique I am in first year of engineering an average guy hoping that ..... this stuff takes time for beginners
Waah bhai thank you i watched a lot of videos of mergesort but no one had explained like u bro❤
very nice explanation of recursion sir , thankyou soo much sir
I haven’t seen anyone making such
in depth videos 😮. You are doing a great job striver ❤
Wow, this DSA course is absolutely fantastic! 🚀 The explanations are clear and easy to follow, and the examples provided really helped solidify my understanding. I've been searching for a comprehensive resource like this, and I'm so glad I stumbled upon it. A huge shoutout to the creator for putting together such a valuable learning resource. Kudos! 👏💯 #DSA #TUF
I am just looking for this type of explanation but no one describes like you. At last you described it in part by part thanks a lot brother. I am a big fa of yours ❤❤
u just taugh this algorithm in the most convenient pattern.. i m just too impressed from ur teaching skill sir... thank you soo much❤ Gol bless u
I tried understanding merge sort from love babbar and Apna college. But strivers dry run made me understand it clearly.
The amount of energy and effort you put in this is amazing
I was not understanding that recursive calls....searched a lot for it but no one explained the way you do...tysm😊
TBH This is my first comment on any study youtube channel ..and i genuinely appreciate this man's effort from bottom of my heart ..whatttaaa explanation ..straight into the head..thankss striver bhaiya 💌💌
Best video, clears all the concept😊😊
After Watching Recursion Videos.
In sorting once concept is know, i am able to write the structure with code on my own.
MAy Be paper work is playing the major role.
Every video is full of content with zero to hero. Its really great🚀🚀🚀🚀🚀
watching ur for first time and my mind blown by ur explanation ....really great work..hats off to u
Once again, an outstanding video! Thank you for investing so much effort in breaking down the approach, providing clear pseudocode, illustrating with recursion trees, and finally, implementing the solution. Take good care of your health too! I hope that you are at least getting sleep for 7 to 8 hours.
Understood So well that now I can give tuitions to my college teachers.
Thankyou for your efforts!! I have never enjoyed learning DSA before the way I enjoy it through your lectures
Thankyou STRIVER, I understood the space complexity of the merge Sort.
What an legit Explaination❤️❤️❤️❤️
The note section is missing the Python Code, Pasting it here,
P.S.: The Merge function is a bit different but the concept is Same.
class Solution:
def merge(self,arr, l, m, r):
# code here
arr1 = arr[l:m]
arr2 = arr[m: r+1]
i = j = 0
while i < len(arr1) or j < len(arr2):
if j >= len(arr2):
arr[l+i+j] = arr1[i]
i += 1
elif i >= len(arr1):
arr[l+i+j] = arr2[j]
j += 1
elif arr2[j] > arr1[i]:
arr[l+i+j] = arr1[i]
i += 1
else:
arr[l+i+j] = arr2[j]
j += 1
def mergeSort(self,arr, l, r):
#code here
if l==r:
return
mid = l + (r-l)//2
self.mergeSort(arr, l, mid)
self.mergeSort(arr, mid+1, r)
self.merge(arr, l, mid+1, r)
How to say I don't know but you're amazing big bro.as...God of coding world... 👌
Thanks for the amazing lecture sir. I've been struggling with consistency for so long. So from now on I'll comment on everything I learn. Trying to get a strong hold of dsa before the intern season starts officially.
non other youtubers has such a type of dedication hats off
06:13 Merge sort is an optimized sorting algorithm.
12:26 Merge Sort is about merging and sorting arrays in a hypothetical manner
18:39 Merge Sort is an algorithm that divides an array into two halves, sorts them, and then merges them.
24:52 Merge Sort Algorithm using Recursion
31:05 Understanding merge sort through pseudocode and dry run
37:18 Explaining the merge sort algorithm
43:31 Merging left and right arrays
49:43 Merge Sort has a time complexity of n*log(n) and a space complexity of n.
Crafted by Merlin AI.
Not just teaching skills but your dedication - recording videos early morning is appreciated
bhai inki ya lovebabar kiska dekhu ma