We have just received an extremely important information that needs to be sorted. The amount of information is huge, and we need to sort it as soon as possible. That is why we decided to use a quick sort algorithm.
The first argument is a path to a file. Every row includes a test case with numbers that you need to sort using quick sort algorithm.
5 2 6 1 3 4 1 2 3 4 4 3 2 1 3 1 2 4 1 3 2 4
You need to calculate and print number of pivots in the array during sorting. This would mean how many times
the array was divided into left and right subarrays.
Pivot is an element which divides an array. If array/subarray has only one element this element is not a pivot.
4 3 3 2 2
- The test case can include from 1 to 30 elements.
- The number of test cases is 40.