Implement heapsort sorting algorithm
Improve quicksort by using heapsort if depth is exceeded