in reply to sort of misunderstanding of sort
Merge Sort performs a constant number of comparison for an input of a given size. (There might be some variations in practice since the smaller subdivisions are usually sorted using something other than merge sort.)
Returning garbage values doesn't not increase the number of comparisons; it just cause the the output to be garbage.
If you wanted to increase the number of comparisons, use an older version of Perl that supports using Quicksort. See the sort pragma.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: sort of misunderstanding of sort
by Discipulus (Canon) on Mar 22, 2023 at 08:02 UTC | |
by ikegami (Patriarch) on Mar 22, 2023 at 19:53 UTC | |
by Anonymous Monk on Mar 23, 2023 at 00:13 UTC | |
by Discipulus (Canon) on Mar 22, 2023 at 08:43 UTC | |
by bliako (Abbot) on Mar 22, 2023 at 12:24 UTC |