in reply to Re^7: Re-orderable keyed access structure?
in thread Re-orderable keyed access structure?
Note however that this is Perl. It is true that one splice is O($#array) in chunks of memory to be moved while a heap moves fewer chunks of memory, O(log($#array)). But it is also true that splice is a single Perl opcode while the heap will be O(log($#array)) in Perl opcodes.
And I wouldn't be surprised if O(1 opcode)+O($#array moves) isn't quite often a win over O(log($#array) opcodes and moves).
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: Re-orderable keyed access structure?
by Aristotle (Chancellor) on Aug 15, 2004 at 06:34 UTC | |
by tye (Sage) on Aug 16, 2004 at 04:34 UTC |
In Section
Seekers of Perl Wisdom