Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 09 · DSA · Four patterns the ladders lean on · about 19 min to read

Play it as a journeyTutor comes with a plan

Other ways to answer range questions

Rotations and Range Trees
Rotations and Range Trees · Open board

The tree view of a range question. This lesson shows three more ways to answer the same question, each good where the tree is not.

Lesson 80 of 96 in DSA

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • A weather office with a list that never changes
  • The sparse table: save the answer for every block whose length is a power of two
  • Square-root blocks: when the readings do change
  • Mo’s algorithm: answer the questions in a different order
  • The sparse table and a range minimum
  • LC 239, Sliding Window Maximum
  • Square-root blocks for range minimum with updates
  • LC 307, Range Sum Query, Mutable
  • Mo’s algorithm: how many different values in a stretch
  • Which one to use
  • Edges and limits

Terms it explains: range minimum query, sparse table, idempotent, square-root decomposition, offline, Mo's algorithm, Common mistakes.

Review DSA