Explanation for the article: www.geeksforgeeks.org/counting... This video is contributed by Harshit Jain.
Пікірлер: 47
@AnhTu-en9gk3 жыл бұрын
This is awesome. I come here from an algorithm course from Stanford. Your explanation is clearer.
@ceciliaw1065 Жыл бұрын
Amazing amazing explanation with examples, thank you so much
@maximilianoromayfigueroa18154 жыл бұрын
thanks for the awesome video, I learned a lot and in a very short period of time ;)
@GeeksforGeeksVideos7 жыл бұрын
Correction at 05:58 --> "the index of element 3 is smaller than the index of element 2." Correction at 10:53 --> "Time Complexity for Simple Method is O(n^2)." [It can also be written as O(n*n)]
@MrSrikanthpai3 жыл бұрын
Nice explanation. Liked it.
@deniz.7200 Жыл бұрын
Thanks for the video, should we also count the inversion happened before merge started??
@goutamkundu63927 жыл бұрын
in the video 08.50 it is "we add the inversion count returned by these two respective calls to inversion count variable". But I am seeing only in the last call inv_count += _mergeSort(arr,temp,mid+1,right) is there
@GeeksforGeeksVideos7 жыл бұрын
Thanks for pointing it out, Goutam. You're right, it's a typo. There should be a plus sign there. The statement should look like this: inv_count += _mergeSort(arr, temp, left, mid);
@alieser77705 жыл бұрын
you are the best!!!
@ariabanazadeh10165 жыл бұрын
just amazing
@kautukraj4 жыл бұрын
Very helpful!
@MisterAadj4 жыл бұрын
geek4geeks u guys awesome
@lovleshbhatt77974 жыл бұрын
Please increase the volume level, its quite less for hearing & understanding
@dsadaddy84032 жыл бұрын
its fine increase yours.
@lalithsamanthapuri9327 жыл бұрын
Thanks a Lot Sir..
@GeeksforGeeksVideos7 жыл бұрын
You're welcome!
@subham-raj4 жыл бұрын
Why did you take "temp" array?
@pranavsingh92842 жыл бұрын
Merge karenge to extra , to merged to temp le lete apan kyu ki inplace merging nhi kr sakte
@tanishqupadhayay13504 жыл бұрын
why do we add mid-i to inv_count??
@davemustainejigsaw7 жыл бұрын
hi, the method 1 described in the code , shouldn't the condition be if((arr[i] > arr[j])&&(i
@GeeksforGeeksVideos7 жыл бұрын
No, since the inner loop runs from j=i+1 so the (i
@abhishek_sengupta4 жыл бұрын
Thanks a lot!!!
@danielhazel7205 Жыл бұрын
does this work for duplicate numbers in an array?
@adithyabhat47704 жыл бұрын
Thank you so much for the video!
@MadhuKumari-gy7uz3 жыл бұрын
Cleared my concept, thanks brother
@sanjananl25013 жыл бұрын
I am unable to dry run the following two lines of code inv_count += _mergeSort(arr, temp, left, mid); inv_count += _mergeSort(arr, temp, mid + 1, right); in _mergesort. Pls help
@dsadaddy84032 жыл бұрын
share the full code then only we can answer
@kurdi_x58422 жыл бұрын
thamk you helped me alot
@anujg33662 ай бұрын
I came after seeing today gfg potd question :)
@tingzhao3931 Жыл бұрын
nice vid
@_-ghost-_7115 жыл бұрын
If I want to print the elements in inversion, then what will be the time complexity.....
@Santosh-om7qk5 жыл бұрын
n^2
@subham-raj4 жыл бұрын
It will be nlogn
@subham-raj4 жыл бұрын
@@Santosh-om7qk You need to improve your skills
@AdeshPaul4 жыл бұрын
Samjhane ke liye dhanyavaad. kya aap yeh bta sakte hain ki agar merge sort aur enhanced merge sort ki same time complexities hain to dono me se konsi behtar hai? Agrim Dhanyavaad.
@shubhamlahoti97584 жыл бұрын
enhanced one is just for the purpose of counting inversions in array
@vineetkothari28397 жыл бұрын
nice
@soumelee5661 Жыл бұрын
4:14 how to get number of inversions ✔✔✅✅ 4:58 examples
@67_ujjwalsolanki78 Жыл бұрын
number of likes represent the number of times I fell asleep watching this
@delyartabatabai96362 жыл бұрын
This is CLRS problem 2-4
@karthikshetty38512 жыл бұрын
It doesnt clear all test Cases
@rupakdas71613 ай бұрын
Worst explanation I have ever seen of an algorithm and just reading the lines of code no dry run how can a beginer understand without doing a dry run
@youtube_username_3 жыл бұрын
It bothers me that he starts talking about mid as if we're supposed to know what mid is.
@FaizaanDatoo3 жыл бұрын
For a more thorough description, I recommend consulting Kleinberg and Tardos: Algorithm Design (the PDF is one of the first results on Google). The relevant text is Chapter 5 - Divide and Conquer, and the section is 5.3 - Counting Inversions. This video helped me understand that section, but I wouldn't have been able to figure it out without both the text and the video.