Space to make list and s to sort.
https://en.wikipedia.org/wiki/Introsort Introsort is a sorting algorithm that combines both quicksort and heapsort. It fisrt does quicksort, but then switches to heapsort if quicksort recurses excessively.