Array
Runtime Complexity
- Lookup (by index) - O(1)
- Lookup (by value) - O(n)
- Insert - O(n)
- Delete - O(n)
In cases when lots of inserts/removals are needed, a Linked List is a better option (unless we add/remove in the middle).
In cases when lots of inserts/removals are needed, a Linked List is a better option (unless we add/remove in the middle).