<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightArrayschevron_rightAdvanced Array
bolt

ARRAYS · CATEGORY

Advanced

Pattern techniques that turn O(n²) brute force into O(n).

Choose a technique

functionsarrow_outward

Prefix Sum

Precompute running totals for O(1) range sums.

O(n)O(n)◍ 0/5
crop_landscapearrow_outward

Sliding Window

Slide a fixed window for window aggregates.

O(n)O(1)◍ 0/5
compare_arrowsarrow_outward

Two Pointer

Converge two indices on a sorted array.

O(n)O(1)◍ 0/5