Array Insertion and Deletion Complexity
Insertion or deletion in the middle of an array is O(n) because the elements after the affected position generally need to be shifted to preserve the array's contiguous ordering.
Insertion may require shifting up to n elements.
Deletion may require shifting up to n elements toward the left.
Insertion or deletion at the end can be O(1) when capacity is available.
Insertion or deletion at the beginning is O(n) because almost every element may move.
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience