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 right refers to moving all elements in a list or array towards the right by one position. The last element becomes the first element after shifting right.
Shift left is similar to shift right but moves all elements towards the left 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.