Counting inversions

  Рет қаралды 24,309

Design and Analysis of Algorithms

Design and Analysis of Algorithms

Күн бұрын

Пікірлер: 9
@ginobean737
@ginobean737 4 жыл бұрын
Excellent explanation! This is the BEST explanation of how to count inversions using a merge sort type algorithm that I have found!
@mishkamn
@mishkamn 5 жыл бұрын
Very good straight to the point and clear
@shahkushal1495
@shahkushal1495 4 жыл бұрын
If courses are bollywood, NTPEL is the Irfan Khan of it.
@dejavukun
@dejavukun 4 жыл бұрын
Thanks a lot sir!
@AbhishekChaturvedi7
@AbhishekChaturvedi7 4 жыл бұрын
superb explanation
@0anant0
@0anant0 4 жыл бұрын
Very nice explanation. Leetcode 493 is based on this.
@pranavyeleti3499
@pranavyeleti3499 3 жыл бұрын
sir countR,R should be mergesortcount(A,mid+1,right).i have a dought.correct me if i am wrong
@cowboymc8230
@cowboymc8230 4 жыл бұрын
What I don't understand is the part : sort and count inversions in L and R. I mean since you sort L and R already, the count of inversions in either L or R would be 0, isn't it?
@0anant0
@0anant0 4 жыл бұрын
Those recursions occur during the "merge" portion of the L and R halves. The very act of sorting L and R involves 'merge' e.g. cInv += mergeSort(lo to mid)
3   1   On log n Algorithm for Counting Inversions I 13 min
12:36
Stanford Algorithms
Рет қаралды 53 М.
Quicksort
17:06
Design and Analysis of Algorithms
Рет қаралды 39 М.
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 910 М.
Teaching a Toddler Household Habits: Diaper Disposal & Potty Training #shorts
00:16
Closest pair of points
16:35
Design and Analysis of Algorithms
Рет қаралды 66 М.
2.6 - Counting Inversions in an Array in O(n log n) time via Divide and Conquer
19:27
Algorithms by Sharma Thankachan
Рет қаралды 10 М.
Examples: Analysis of iterative and recursive algorithms
17:22
Design and Analysis of Algorithms
Рет қаралды 76 М.
Why Is Merge Sort O(n * log(n))? The Really Really Long Answer.
36:50
Back To Back SWE
Рет қаралды 115 М.
Counting inversions in an array
19:03
Techdose
Рет қаралды 91 М.
How To Think Like A Programmer
1:00:07
Coding Tech
Рет қаралды 2 МЛН
This is why Deep Learning is really weird.
2:06:38
Machine Learning Street Talk
Рет қаралды 387 М.
Can you Pass Oxford University Entrance Exam ?
11:29
Super Academy
Рет қаралды 2,6 М.
Postgres just got even faster
26:42
Hussein Nasser
Рет қаралды 22 М.