in reply to Re: In-place sort with order assignment
in thread In-place sort with order assignment
I believe @a = sort @a; works in place. O(1) memory, O(N) time.
That isn't the (whole) problem. Creating the array from the keys of the hash effectively doubles memory usage, before you ever get to the sort.
This has already been discussed in the thread.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: In-place sort with order assignment
by ikegami (Patriarch) on Sep 20, 2010 at 14:27 UTC | |
by BrowserUk (Patriarch) on Sep 20, 2010 at 16:27 UTC |