Operation Panel
System LogWaiting for command...
💡 Why is this costly?
- Arrays are contiguous blocks of memory.
- To insert at index
k, we must physically move everything from k to N one step right to make room. - To delete at
k, we must shift everything from k+1 to N one step left to plug the hole. - Worst case (Insert at 0): We move N elements. Thus, complexity is O(N).