Apply quick sort algorithm (#738)

Apply quick sort algorithm (#738)

Partition array around a pivot, sort subarrays recursively.