Added linearithmic method to count inversions in array