Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
Shift left refers to moving all elements in a list or array towards the left by one position. The first element becomes the last element after shifting left.
Shift right is similar to shift left but moves all elements towards the right by one position instead.
circularShift: Circular shift involves moving elements within a list or array such that they wrap around from one end to another. It's like shifting positions on a circular track.
rotateArray: Rotate array means changing its order by shifting its elements either left or right by certain positions.