lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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.