Perl arrays use a doubling trick to ensure that push and unshift are near O(1) like with linked lists.
Unshifts are O(1).
Unshifts and pushes are amortized O(1) (meaning O(N) to do N of them).
In reply to Re^9: [OT:] Is this Curriculum right?
by ikegami
in thread [OT:] Is this Curriculum right?
by karlgoethebier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |