|
On 25/08/16 10:22 PM, nobody wrote:
On 2016-08-26 03:14, Soni L. wrote:Heapsort assumes there is a length. Insertion sort is just bad, nowhere near quicksort, and it also iterates, effectively calculating a length.All sorting algorithms have to eventually do something roughly equivalent to determining the length. As long as there may be a next element, it may be smaller than any of the previous ones. So you can't output even a single element before you know that you've received all of them.
All known* sorting algorithms have to eventually do something roughly equivalent to determining the length.
There is no proof that all sorting algorithms have to. -- Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.