templated out structures for quicksort and mergesort