in reply to Re^8: [OT:] Is this Curriculum right?
in thread [OT:] Is this Curriculum right?
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: [OT:] Is this Curriculum right?
by LanX (Saint) on Nov 28, 2021 at 05:33 UTC | |
by ikegami (Patriarch) on Nov 28, 2021 at 18:41 UTC |