wrote sorting algorithm using the partition problem