Arrays easy time O(n) space O(1)
Insert into an Array
To insert at position p, every element from p onward slides one place right to open a slot — that shifting is why array insertion is O(n).
Insert 10 at index 2.
1 / 4
Practice
Machine twin: /dsa-viz-v2/array-insert.json — the full deterministic run as structured data.