2 ms·
That's going to be tricky to do with quicksort... you could definitely do it with mergesort, though, but you'd have to abandon the in-place guarantee. The basi
by drostie 11y ago
That's going to be tricky to do with quicksort... you could definitely do it with mergesort, though, but you'd have to abandon the in-place guarantee.
The basic problem is that Array.prototype.sort() does not accept indexes for a slice of the array to sort between.
- KayEss 11y agoIt's simple enough if you split the list at the partition point, but hard if you do it in place.