more useful options | |
PerlMonks |
Re^3: [OT] A measure of 'sortedness'?by sauoq (Abbot) |
on Mar 19, 2015 at 15:51 UTC ( [id://1120609]=note: print w/replies, xml ) | Need Help?? |
The more I've thought about this, the more I doubt the first pass is really going to buy much at all that'll make your merge more efficient. In the long run, you still have to do the same comparisons and the same moves. In terms of performance, it doesn't matter much which loop they're in. My original thought above, if it's feasible at all, only really adds overhead in almost every case. The only little chance of saving anything, I think, is if you have a chunk of data at the beginning or end of the combined buffer that doesn't have to move. You might be able to identify that on your first past and shorten your second pass to the data in between. That's all I got.
-sauoq "My two cents aren't worth a dime.";
In Section
Seekers of Perl Wisdom
|
|