Skip to content
CCC Python Course

Circular arrays

Stage
4
Module
M4.15
Lessons
1

In this module

  • Understand how circular arrays wrap around at the end back to the start.
  • Use modulo arithmetic to compute circular indices.
  • Implement a circular buffer or sliding window that wraps.
  • Apply circular thinking to solve rotation and cyclic problems.

Before this module

Lessons

  1. 1Circular arrays and wraparound

Practice

Try these on the judge. Each link opens the problem on DMOJ.

  1. 2020 J4
    Cyclic Shifts (opens on DMOJ in a new tab) DMOJ

    Check whether one string is a circular shift of another.

  2. 2020 S4
    Swapping Seats (opens on DMOJ in a new tab) DMOJ

    Use circular prefix sums to answer range questions that wrap around.