whoashish's cp notes

Home

❯

7. Data Structures

7. Data Structures

Oct 08, 20262 min read

  • i. Containers, Hashing and Choosing a Structure: What the standard containers really cost, how to hash safely and fast, and a decision map to pick the right structure for a query pattern.
  • ii. Ordered Set and PBDS: std::set can’t answer “k-th smallest” or “how many are less than x”.
  • iii. Heaps: The binary heap is the default priority queue.
  • iv. Disjoint Set Union: Union-find maintains a partition under “merge two sets” and “which set is x in”.
  • v. Treaps and Balanced BSTs: A treap is a BST on keys and a heap on random priorities, so it has expected depth O(logn) with no balancing code.
  • vi. Chtholly Tree (Interval Map): Store the array as maximal runs of equal values in an ordered map.
  • vii. Binary Trie: A trie over the bits of integers, most significant bit first.
  • viii. Fast Set and Integer Structures: When keys are integers in [0,n), word-level tricks beat comparison-based trees.
  • ix. KD-Tree and Spatial Structures: A KD-tree splits points by the median along alternating axes.
  • x. Persistent Data Structures: A persistent structure keeps every version.
  • xi. Data Structure Catalog: every structure in one place: operation costs, measured memory per element, iterator stability and when to use it.

11 items under this folder.

  • Oct 22, 2026

    xi. Data Structure Catalog

    • data-structures
  • Oct 08, 2026

    i. Containers, Hashing and Choosing a Structure

    • data-structures
    • hashing
    • stl
  • Oct 08, 2026

    ii. Ordered Set and PBDS

    • data-structures
    • pbds
    • order-statistics
  • Oct 08, 2026

    iii. Heaps

    • data-structures
    • heaps
  • Oct 08, 2026

    iv. Disjoint Set Union

    • data-structures
    • dsu
  • Oct 08, 2026

    v. Treaps and Balanced BSTs

    • data-structures
    • treap
    • bst
  • Oct 08, 2026

    vi. Chtholly Tree (Interval Map)

    • data-structures
    • intervals
  • Oct 08, 2026

    vii. Binary Trie

    • data-structures
    • trie
    • xor
  • Oct 08, 2026

    viii. Fast Set and Integer Structures

    • data-structures
    • integers
    • word-ram
  • Oct 08, 2026

    ix. KD-Tree and Spatial Structures

    • data-structures
    • geometry
    • kd-tree
  • Oct 08, 2026

    x. Persistent Data Structures

    • data-structures
    • persistence