I am in love with his teachings..!!! way too good...!!!!! Simplifies anything and everything..!!! Thank God you were born Sir..!!!! This world needed you so much. Students like us who want to understand but can't find a proper tutorial anywhere need you so much..!!!! We want to learn..!!! Thank you very very much Sir...!!!!
can we have lectures , explaining counting sort radix and bucket sorts plzz??and also some questiond on iteration method of solving recurrence in algorithms?
I am searching merge sort and watch more than a dozen of videos from last week but I stop here and this is so amazing to understand ,even IIT ,MIT lectures are not that much precise.
instead of adding a large enough number at the end of the left and right lists respectively, wouldn't it be better to add a conditional that says if one of the pointers reaches the index of the size of the list -1, then just copy the remainder of the other list from its pointer and add it to the main list?
Thank u so much for this video sir.... :D I used to get bored watching tutorials made by others on Merge Sort.... But, your tutorials are just great as usual.... Thanks a lot for the effort sir.... Thank u so much... :D
Hi Ravindra, I checked your lecture and I found that you have mentioned (15:50 second of the lecture) that the merge sort space complexity will not remain Big O (n) in case of: If we have "N" numbers to sort in "N" space., Please note that if we ll use While loop Instead of For loop then it ll not effect its space complexity and also we don't have to worry about Infinity concept. Please correct it. Thanks
At 34:28 sir is saying we can declare a global array of size n but for input size of n we will need n+2 spaces (two extra one one for placing infinity), then why sir said its n size
No only one infinity space coz only one global array have one infinity at end (to copy rest of elements from both list to be one list)and even one list have one infinity at end.
Hello sir,I had watched this vedio of merge sort algorithm.Your teaching style is awesome.But one doubt arises in my mind and that is can a merge algorithm which is heart of merge sort algorithm is applied on two way merging which you have done in questions you have solved in the last few minutes of this vedio.It is because in merge algorithm there should be an array which is a combination of two sorted list and then we seperate them in two different list and then we merge them in sorted form in the same array.And in two way merging we just simple merge the two -two sorted list which is totally different from merge algorithm concept.I kindly requesting you to clear my doubt.
Best explanation of merger sort you can find on RU-vid. I already go throguh 2-3 videos today of merger sort but still didn't get how the mergeSort recursion is working. But now I am all clear.
Your lectures are so much better than even d MIT lectures!! Seriously,amazing! :O You go into details which is what is truly needed to get a good grasp over the topic.MIT just skims through the topic and jumps to advanced analysis !
Of course I haven't went to MIT. But I could solve more questions after doing these lectures rather than doing those lectures. Everyone has their own preferences
vishnu priyan you are just showing that you have a brain which is worse than my shit. RB himselfs says that he is lectures are made for gate... And is not wholesome. He goes below at ur level so dumbass like u can understand.. If you can not understand anything from mit's lecture.. Bcos they assume u know the base.. Nd they don't waste time. Now if ur brain is full of shit... It's your fault
vishnu priyan see.. I said you have shit in ur brain. And it stinks too like ur comment. The professors whom you are able to see becos of a noble initiative are far beyond ur reach. Not every one can be a part of ivy league. Respect them. Their hardwork. If u feel u r not getting it.. It bcos ur brain has dark yellow metter (not grey).and don't worry about me if I don't know anything i'll learn it if it is neccesary.
superb lecture and awesome teaching..i understood merge sort completely. u are the best teacher sir i am your fan now... plz plz upload more such lectures
sir I wanted to ask you one thing ..like we are using recursion so first time our mid value came to be 3 which is fine then again tht same function will call itself till p becomes less than q but in this way thn how it's going to next step ..loop will break when condition becomes false ..so how will the same function works for other half ?
For the question on sorting n strings of size n in lexicographical order, the time taken could be tightened to O(n^2) instead of O(n^2 log(n)) as he said. Just use the recurrence T(n) = T(n/2) + O(n^2) and apply masters theorem.
sir you are awesome your videos proved to be very useful in acquainting the in depth knowledge in toc and data structures thanks a lot for uploading such precise videos
Salute you sir. After 15 days effort i was able to understand the merge sort. If i get your lecture 14 days before i would be able to understand it in one day . Thank you
i have seen few other videos as well for merge sort technique, but i didn't see any clear detailed explanation of the process like this, thanks a lot !!!
Great video sir!! I'm studying CS in 3rd year and had a problem analyzing time complexities. But your video was very clear and to the point for understanding the matter...only one question: Will merge sort happen if the array were of an unequal size? Like there were 5 elements in there...9,7,1,3,5..like this???
Tell me if I'm wrong. The time complexity for merge sort is: O(total number of elements to be sorted * height of the tree) Height of the tree will be log of number of lists to be sorted. First problem: Number of elements = n. Total number of lists to be sorted = n, therefore the height of the tree is log(n) => O(n* log n) Second problem: Number of elements = n. Number of lists to be sorted = log n. Height = log(log n) => O(n* log log n) Third problem: Number of elements = n*n Number of lists (strings) = n. Height = log n => O(n^2 log n)
Sir,please upload a video on other concepts like Greedy algorithm n its implementation and also on heap using priority queue...it wud be very helpful of u sir ,thank u:)
in problem of n/logn the climbing you said loglogn but in the problem of n elements in n sorted list you said we have to cross logn level... I am confused.Would you plzzz explain it?
Sir, thanks for giving me this much please change the keywords for search in youtube because people dont hav access to it easily... this lectures hav to got more than 1 lakhs likes and views thanks sir
Suppose total number of elements n=2^k. Then at the bottomost level there will be 2^k elements and the topmost there will be 2^0 i.e. 1 element. Thus we hav a range from 0 to k i.e. (k+1)range. Now remember n=2^k thus k=logn Similarly, for 2^(k+1) we get n=(log n)+1. Hope this clears your doubt.
Can anyone tell me why do we have to add infinity at the end, the explanation given for adding infinity same can be achieved by matching the pointer with the size of sub arrays, this will avoid creation of extra space in memory.
So, infinity means... largest number a datatype can get right? so say the array is of type Integer, then infinity means Maximum number an integer can hold. So, your code doesn't work if the actual element is largest number an integer can get (infinity). In the array at 14:49, if you get 2 pow 32 -1 in place of 10, your code gets an array index out of bounds exception.