← Back to Index

🔺 Heap Pattern

🧠 When to Use

⚙️ Java Syntax

// Min-heap
PriorityQueue<Integer> minHeap = new PriorityQueue<>();

// Max-heap
PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());

📌 Common Techniques

🔥 Popular Problems

📊 Time Complexity

🧠 Pro Tips