[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Length-unaware sorting algorithm
- From: nobody <nobody+lua-list@...>
- Date: Fri, 26 Aug 2016 03:22:24 +0200
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.