Browse curriculum

Arrays

Array Algorithms and Techniques

Arrays are where most coding interviews begin, and where the highest-leverage techniques live. Two pointers, sliding window and prefix sums between them turn a large share of quadratic brute-force solutions into linear ones, which is usually the entire difference between a passing and a failing answer.

The visualizers matter more here than almost anywhere else, because these techniques are defined by index movement. Watching a left pointer advance only when a constraint breaks makes the sliding window rule obvious in a way that reading the loop condition does not. Once these are solid, the same techniques reappear as named patterns in the interview pattern library.

6

Interactive lessons

4

Free to open

6

Languages (JS, TS, Python, Java, C, C++)

Lessons

Arrays lessons

Complexity

Arrays time and space complexity compared

Best, average and worst-case running time and extra space for every arrays lesson, as each lesson derives them.

LessonBestAverageWorstSpace
Array OperationsO(1)O(N)O(N)O(N)
Two PointersO(1)O(N)O(N)O(1)
Sliding WindowO(N)O(N)O(N)O(1)
Prefix SumO(1)O(1)O(1)O(N)
Kadane's AlgorithmO(N)O(N)O(N)O(1)
Boyer-Moore VotingO(N)O(N)O(N)O(1)
Curriculum

Continue the DSA curriculum

Arrays is one of 12 topics in the interactive DSA visualizer curriculum. Once this topic is comfortable, the coding interview pattern library reorganises the same material around the patterns interview questions are built on.

Directory

Every other DSA visualizer