find inversions in an array in O(n). one of the cs560 assignments.