Array Delete
Close the gap by shifting everything after the slot one place left.
Result · step 1 of 6Array: Delete index 1
Delete index 1. Removing 1 leaves a gap that everything to the right must close.
What you will see
The deleted cell empties; cells slide left to close the gap.
Cost
| Best | O(1) |
|---|---|
| Average | O(n) |
| Worst | O(n) |
| Space | O(1) |
Best case is deletion at the end.
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next.
Screen readers: Each cell is announced as index, value and state; each step's accessibility text states the decision and its effect.
Reduced motion: Swaps and shifts become value crossfades with an outline flash; pointers appear at their destination.
Before this
Related
Taught by the same lesson
Array covers these too, in the same run.