Add mergesort and quicksort implementations