exercise 3-6: quicksort
exercise 3.7: mergesort