what a explanation!!!!! I have gone through many no of lectures and book this one is simply amazing
@rajnandinipatel81 Жыл бұрын
hats off to your pedagogy. literally understood every segment of the code.
@karanamunjani84514 жыл бұрын
WOWWW!! It is "the" best explanation I seen. Thank You so much!!!
@GATEAppliedCourse4 жыл бұрын
Glad it was helpful!
@SmilesOnly101 Жыл бұрын
this video and part 1 of this video togeather are the best possible explanation in a very detailed and relaxed manner. I am simply too amazed and grateful to find such an amazing lecture in this. I saw all this written in my notes and was not able to understand it myself. than you sir .
@Zleurstars9 ай бұрын
indian teachers are so intuitive and know what the students struggle with absolutely amazing!!
@dishithagurram41543 жыл бұрын
This way of explanation is just amazing!
@blue-go4gr3 жыл бұрын
GOD BLESS YOU ..... I can not express enough how much this vid helped me .... I was this close 👌 to cry ;-;
@GATEAppliedCourse3 жыл бұрын
Thank you.
@rajeshrajendran55123 жыл бұрын
This is the explanation I always wanted from an Algorithm analysis point of view. Great job.
@Sam-kr5ix4 жыл бұрын
What an amazing explanation keep up the great work
@GATEAppliedCourse4 жыл бұрын
Thanks, will do!
@TheFineDine_3 ай бұрын
awsome explaianation...no one has teach this topic better than u
@kanikakhatri09 Жыл бұрын
OMG!!! just loved the way u explained each and every concept. LOVE LOVE LOVE
@angitd37664 жыл бұрын
one of the best explainations ever
@nadun_li Жыл бұрын
This explation really helps. Thankyou so much
@tahirbintariq89342 жыл бұрын
Such a beautiful explanation sir!!!
@naziyabegum91638 ай бұрын
thannkkk youuu sir for this video, I was struggling with this topic and I am glad that I have found this video.
@jinhuang7258 Жыл бұрын
So good. Thank you for sharing your knowledge and passion with us.
@daniaayad587411 ай бұрын
that was a very useful video, the explanation is perfect thank you soo much
@bassmw81753 жыл бұрын
Excellent. You explain it very well!
@madhuram63283 жыл бұрын
But sir one doubt as you said the maximum number of comparison will be 1 (for j=2) for worst case . But this is not about comparison it is about no of time the while loop gets executed so the maximum number of times the for loop gets executed is 2 for (j=2)( ex a={10,9,8,7 } here n is the length therefore it is 4 and the element 9's for loop gets executed 2 time because first time the condition will be true and for the second time it becomes false and the loop gets terminated. So the minimum number is 2 not 1. and the contents or the statements inside while loop gets executed only one time). Someone correct me if I'm wrong.
@thebishalpaul2 жыл бұрын
Absolutely correct for which the max times while loop(not comparison) will run would be (n*(n+1)/2)-1 i.e for j=2 while count: 2 for j=3 while count 3 and so on so exclude the first number from sum of n nos.
@lmcst2821 Жыл бұрын
Thanks man. I had doubts because in Cormen's Algorithms book it said \sum_{i=2}^n t_i but I was not so clear about it.
@mrsmelaniecook2 жыл бұрын
Thank you so much. I finally got it!
@muhammadabrar90579 ай бұрын
this man is love.... love from pakistan
@paramjeetsingh34443 жыл бұрын
sir I have a lot to write for the video but i think 1 word will cover it all.. THANK YOU
@ghulamahmad66882 ай бұрын
hats off !! amazaing !!
@HafidRecords4 жыл бұрын
Thank you. Finally I could understand!
@yashedits346628 күн бұрын
What is the best , worst and average case scenario in quick sort and merge sort ... explain in detail with example and time complexity
@ManojK-jl2ue2 жыл бұрын
excellent explanation...thank you sir
@yoursgkt29273 жыл бұрын
It will be really helpfull if you can share these slides.
@gateprep80765 жыл бұрын
Sir I have the same doubt In worst Case the array should be reverse sorted. Please make it clear. Rest of the content is super clear. I appreciate that.
@RaniLink4 жыл бұрын
When you get to the 5th element the 4 elements prior to it have been sorted. so the array might as well been reverse sorted, then this individual worst case had happened for every number along the way up to the 5th one.
@lzmkalos9 ай бұрын
best explication everrrrrr
@3bood_kr Жыл бұрын
Worst case is when the array is sorted in descending order
@techso6059 ай бұрын
I want to ask that the swapping and the decrement of i will be one less then the time while loop is executing so we should minus 1 in 6th and 7th step in worst case.
@davewebb3540 Жыл бұрын
I was with you up until the a, b bit. How did you sum it all up? Feel like I'm missing something.
@arpitbhaliya29724 ай бұрын
Great👍😊
@MelodyUnplugged-t4 жыл бұрын
Thankyou. you have explained beautifully. :)
@pruff50723 жыл бұрын
My textbook for worst case on line 5 has a slightly different answer: c5 * ((n(n+1)/2) -1
@SVNITPhool3 жыл бұрын
Yes that's correct becuase in worst case j comparison not j-1 .so 2+3+.......+n=(n*(n+1)/2)-1.
@StatusKing122 жыл бұрын
In the book did they use for loop?
@amoodaniel4 жыл бұрын
pls, what app did you use for the onscreen writings?
@iamnottech8918 Жыл бұрын
Just wow
@donkeykong56163 жыл бұрын
Doin gods work
@АйдарБабанов-ж4п4 жыл бұрын
I think, you made a mistake in number of comparisons for j. if j == 2, then i == 1. We make comparison and after one iteration of while loop i becomes 0. Then we make last comparison. So, max amount of comparisons starts from 2 to n. Number of swaps is correct.
@shreyanshayanger4 жыл бұрын
When i becomes 0 we don't compare as the conditon "i > 0" get's violated in while loop.
@АйдарБабанов-ж4п4 жыл бұрын
@@shreyanshayanger well, if i becomes 0, we have to make one last comparison, the condition (i>0) why loop stops it's working.
@АйдарБабанов-ж4п4 жыл бұрын
@@shreyanshayanger so if j==2, amount of comparisons for i is 2.
@shreyanshayanger4 жыл бұрын
@@АйдарБабанов-ж4п no brother ....the program enters in comparison phase when "i>0" if i=0 the program won't run the code in while's body hence no comparison
@shreyanshayanger4 жыл бұрын
@@АйдарБабанов-ж4п when j = 2 , i=j-1 ,so only one comparison between A[i]/A[1] and A[j]/A[2]
@oitik2 жыл бұрын
it helped thamks
@MelodyUnplugged-t4 жыл бұрын
isn't the value of c1,c2...cn should remain constant otherwise there will be arbitrarily growth which we do not want??
@gavinaren85344 жыл бұрын
Perfect vid
@grandparick31764 жыл бұрын
What will be the avg case for this? I know its the same as the worst case but can anyone show by steps.
@safwansabir75669 ай бұрын
the math of time complexity is wrong is should be ((n+2)(n-1))/2 not n(n+1)/2 you can dry run the algo yourself and compare the answers with both equations yourself
@louerleseigneur45325 жыл бұрын
Thanks sir ji
@captainabhijeeth31544 жыл бұрын
Sir,I did't get that how it became "an+b"
@aimenbaig62014 жыл бұрын
same
@punitpal3155 жыл бұрын
Sir here when u r explaining worst case , u taken array in which all element are sorted except element 0 . So it will not give worst case complexity. So according to me for worst case you have to take array which should be completely in descending order for worst case . Thank you
@RaniLink4 жыл бұрын
When you get to the 5th element the 4 elements prior to it have been sorted. so the array might as well been reverse sorted, then this individual worst case had happened for every number along the way up to the 5th one