Created quicksort and partition functions.