in reply to Re^9: In-place sort with order assignment (calculations)
in thread In-place sort with order assignment
(and ignoring duplicates altogether).
Of course it ignores duplicates. There might not be any. As with most such analysis, it also ignores the possibility that the input is already sorted.
It only addresses your remark that duplicates could be removed on output to spill files, as well as during the merge operation.
It would be interesting to see what difference your modifications to the classic algorithm would make in use.
Your computations involving N and S seem to be wandering around thinking that merge sort is something other than O(N*log(N))
Hm. If there was no scope for achieving better than O(N log N) with your "early de-duplications", then this discussion would be entirely moot.
The reason for separating out the merge step, is because if you've already eliminated some duplicates during the spill, then the N involved in the merge is reduced from the input N. But, the unquantifiable bit, is how many of the duplicates were eliminated.
As far as I can see, the only way you could achieve O(N log U), is if you could eliminate the duplicates without ever performing a comparison to find them. Seeing is believing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: In-place sort with order assignment (runs)
by tye (Sage) on Sep 21, 2010 at 23:00 UTC | |
by BrowserUk (Patriarch) on Sep 21, 2010 at 23:24 UTC | |
by BrowserUk (Patriarch) on Sep 22, 2010 at 08:11 UTC | |
by salva (Canon) on Sep 22, 2010 at 08:46 UTC | |
by BrowserUk (Patriarch) on Sep 22, 2010 at 10:30 UTC | |
by JavaFan (Canon) on Sep 22, 2010 at 09:27 UTC | |
by salva (Canon) on Sep 22, 2010 at 10:09 UTC | |
|