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.
Glossary: Data Structures and Algorithms in Python
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.