On Sun, Mar 10, 2002 at 10:16:05PM +0000, Jonathan E. Paton wrote:
> A lazy sort can be done in n time, easily:
>
> @highest;
> foreach element {
> if (element > lowest in @highest) {
^^^^^^^^^^^^^^^^^^
You haven't kept @highest sorted, so there is another factor of n.
> stick in @highest, removing lowest in @highest;
> }
> }
> return sort @highest
Andrew
Thread Previous
|
Thread Next