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.
In reply to Re: sort of misunderstanding of sort
by ikegami
in thread sort of misunderstanding of sort
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |