Search⌘ K

STL

Understand how to use the C++ STL priority_queue to implement max and min heaps efficiently. This lesson covers essential heap operations, priority_queue syntax, and techniques to adapt it for min heaps, preparing you to apply these concepts in competitive programming problems.

Library

While solving a problem, we’ll be using heap from C++ STL (priority_queue).

Below are some of the operations that we’ll use frequently. For complete documentation about how they work, check ...