implement quicksort and mergesort using lists