Skip to main content

count_inversions_f64

Function count_inversions_f64 

Source
pub fn count_inversions_f64(data: &[f64]) -> u64
Expand description

Count the number of inversions (pairs where data[i] > data[j] for i < j).

Uses a simple O(n log n) merge-sort-based inversion count.