Added merge sort algorithm with counter of inversions into unsorted array.