Back to Data Structures & Algorithms

Arrays

Mastering array manipulations with techniques like prefix sum, sliding window, two pointers, and Kadane's algorithm.

1 week

Topics in this Chapter

1

1D/2D Arrays

Reviewing fundamentals of 1D and 2D arrays, including memory representation and traversal patterns.

2

Prefix Sum

Using prefix sums to answer range sum queries in O(1) time after an O(n) preprocessing step.

3

Sliding Window

Solving problems involving contiguous subarrays by maintaining a 'window' of elements.

4

Two Pointers

Using two pointers to iterate through an array for efficient searching and subarray processing.

5

Kadane’s Algorithm

Finding the maximum sum of a contiguous subarray in O(n) time.

6

Subarray Problems

Applying learned techniques to various subarray-related challenges (e.g., counting, specific sums).

GeekDost - Roadmaps & Snippets for Developers