Feb. 21, 2014, 4:24 p.m. by Rosalind Team
Topics: Sorting
A partition procedure is an essential part of the Quick Sort algorithm, the subject of one of the following problems. Its main goal is to put the first element of a given array to its proper place in a sorted array. It can be implemented in linear time, by a single scan of a given array. Moreover, it is not hard to come up with an in-place algorithm.
Given: A positive integer
Return: A permuted array
9 7 2 5 6 1 3 9 4 8
5 6 3 4 1 2 7 9 8