mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-05 03:29:46 +08:00
Update sorting/count_inversions.cpp
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
* two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j
|
||||
*
|
||||
* Time Complexity --> O(n.log n)
|
||||
* Space Complexity --> O(n) ; additional arrat temp[1..n]
|
||||
|
||||
* Space Complexity --> O(n) ; additional array temp[1..n]
|
||||
* ### Algorithm
|
||||
|
||||
* 1. The idea is similar to merge sort, divide the array into two equal or
|
||||
|
||||
Reference in New Issue
Block a user