Microsoft Interview Question

Implement BinarySort and the partition function for Quicksort.