All challenges
Multiple ChoiceIntermediate 30s

Difference array

A difference array enables:
Options
  1. 1Sorting arrays stably in linear time
  2. 2Range updates in O(1), point queries in O(n)
  3. 3Searching graphs with breadth-first traversal
  4. 4Point updates in quadratic O(n²) worst case

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle