Splice is O(N) only if you require that the Perl array be optimized for random access.
Indeed, you could even implement Perl arrays as linked lists and then...
But that is, of course, quite beside the point of what a "Perl array" is (not what it might one day be in some unlikely future of your imagination). What a "Perl array" is not, is a linked list. And splice is not O(1) for a Perl array, no matter how strenuously you object to reality. :)
- tye
In reply to Re^6: Array VS Linked List (reality)
by tye
in thread Array VS Linked List
by asset
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |