Skip to content

Data Structures -> Pairing Heap / Leftist Heap

Use a meldable heap when many singleton heaps keep unioning and the real primitive is merge rather than push.

  • Topic slug: data-structures/pairing-leftist-heap
  • Tutorial page: Open tutorial
  • Ladder page: Open ladder
  • Repo problems currently tagged here: 1
  • Repo companion pages: 4
  • Curated external problems: 2

Microtopics

  • meldable-heap
  • leftist-heap
  • pairing-heap
  • merge
  • delete-min
  • owner-tracking

Learning Sources

Source Type
OI Wiki leftist tree Reference
OI Wiki pairing heap Reference
Luogu P3377 Practice

Practice Sources

Source Type
Luogu P1456 Practice

Repo Companion Material

Material Type
Pairing / Leftist Heap hot sheet quick reference
Mergeable Heap 1 flagship note
Heaps And Ordered Sets compare point
Template Library exact starter route starter route

Curated External Problems

Core

Problem Source Difficulty Context Style Prerequisites Tags Why it fits
P3377 [Template] Mergeable Heap 1 Luogu Medium Meldable-Heap, Leftist-Heap Data-Structure-Heavy; Implementation Priority Queues; Heap Merge; Owner Tracking Delete Min; DSU; Simulation The cleanest verifier-style first rep where every item starts in its own heap, heaps meld online, and delete-min is asked by naming one item's current heap.

Challenge

Problem Source Difficulty Context Style Prerequisites Tags Why it fits
P1456 Monkey King Luogu Hard Meldable-Heap Data-Structure-Heavy; Implementation Heap Merge; Delete Min; Owner Tracking Leftist Heap; Heap Merge A classic follow-up where the same meldable-heap route survives after each duel mutates the current roots before the heaps merge again.

Repo Problems

Code Title Fit Difficulty Pattern Note Solution
MERGEABLEHEAP1 P3377 [Template] Mergeable Heap 1 primary medium - Note Code

Regeneration

python3 scripts/generate_problem_catalog.py