Hmm. I guess we have different understandings of the term In-place sort.
I was trying to sort (using the default algorithm), 20e6 elements which takes 400 MB, but it was consuming 1.4 GB gross (some memory has been return to the system by the time the second memcheck runs below).
C:\test>junk
Mem after building array: 404,556 kb
Mem after sorting array: 1,214,032 kb
Having read your post, I tried the _quickersort option. Things improve marginally, but:
C:\test>junk
Mem after building array: 404,812 kb
Mem after sorting array: 973,584 kb
But that still requires a gross memory usage of 1.3 GB. 2N additional memory is somewhat greater than logN.
A useful feature, and nice to know it's there, but not quite what I was expecting hoping for when you said in-place.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|