3 ms·
While I generally agree with you, I have had multiple occasions where amortized O(1) was unacceptable, whereas the overhead of linked lists was ok.
by bjoli 4y ago
While I generally agree with you, I have had multiple occasions where amortized O(1) was unacceptable, whereas the overhead of linked lists was ok.
- eru 4y agoYou can make dynamic arrays have worst case O(1) at the cost of some extra overhead.
- bjoli 4y agoCopy the array on every append? :)
- Slasher1337 4y agoThat would not be O(1), but O(n) per insert.