Ryan Naughton

Results 2 issues of Ryan Naughton

One of the key advantages of heap sort is it can be an in place algorithm (https://en.wikipedia.org/wiki/In-place_algorithm); however, your implementation does not do an in place implementation: https://github.com/kanwei/algorithms/blob/master/lib/algorithms/sort.rb#L85-L90 Instead, you...

Quicksort should first randomly shuffle the container. If it doesn't and the array is already sorted, then it will actually be O(n^2), which is the worst case. By shuffling, it...