← Course home

Python reference · Reference

Range queries and approximate structures

Answer exact range questions and understand the tradeoffs of probabilistic structures.

ReferenceAbout 2 min

This page lists the library modules for Range queries and approximate structures. The lesson is Range-query structures.

This page is the module index for range queries and approximate structures.

  • range_queries/structures.py — Fenwick tree, lazy segment tree, sparse table for RMQ.

Focused lessons

  • approximate/structures.py — Bloom filter, skip list, persistent stack frames.

Industry

A working engineer uses a Bloom filter when a definite miss is enough to skip a lookup. Redis documents BF.ADD to add an item and BF.EXISTS to test one: a hit means the item was probably added, and a miss means it was definitely not. A Fenwick tree or a segment tree is the structure in this lesson when the answer has to be an exact prefix or an exact range.

Implementation and tests Optional reference

Library code 2

  • bitsandbytes.range_queries.structures
  • bitsandbytes.approximate.structures

Use these references to compare the explanation with repository code and tests. A test link means it imports a lesson symbol; it does not by itself claim complete behavior coverage.