Skip to content

Glossary: Data Structures and Algorithms in Python

Shifting

Also written: shift, shifts

Moving items along a list to open or close a gap, which costs O(n). It's why `insert(0, x)` and `pop(0)` are slow.

Where the book teaches it

Related terms

ArrayInsertion sort