count the number of inversions, validate some hypothesis about the number of ordered subarrays, merge sort and random shuffle of linked list