---
title: "#heaps articles | Hashnode"
description: "Explore 10 articles tagged #heaps on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/heaps"
---

Tag

# #heaps

10 posts · 0 followers

[Abstract Algorithms](https://hashnode.com/@abstractalgorithms) · [Mar 29](https://hashnode.com/posts/kway-merge/69c8c163954e773469560486)

### [K-Way Merge Pattern: Merge K Sorted Sequences with a Min-Heap](https://abstractalgorithms.hashnode.dev/kway-merge?utm_source=hashnode&utm_medium=feed)

A min-heap tracks one pointer per sorted list. Pop the global minimum, advance that list's pointer, repeat.

16 min read · [abstractalgorithms.hashnode.dev](https://abstractalgorithms.hashnode.dev/kway-merge?utm_source=hashnode&utm_medium=feed)

[Abstract Algorithms](https://hashnode.com/@abstractalgorithms) · [Mar 29](https://hashnode.com/posts/top-k-elements/69c8c16b954e773469560488)

### [Top K Elements Pattern: Find the Best K Without Sorting Everything](https://abstractalgorithms.hashnode.dev/top-k-elements?utm_source=hashnode&utm_medium=feed)

Maintain a min-heap of size K. Anything smaller than the current minimum gets evicted immediately.

14 min read · [abstractalgorithms.hashnode.dev](https://abstractalgorithms.hashnode.dev/top-k-elements?utm_source=hashnode&utm_medium=feed)

[Abstract Algorithms](https://hashnode.com/@abstractalgorithms) · [Mar 29](https://hashnode.com/posts/two-heaps-pattern/69c8c173811cfe4e5e5940d7)

### [Two Heaps Pattern: Find the Median of a Data Stream Without Sorting](https://abstractalgorithms.hashnode.dev/two-heaps-pattern?utm_source=hashnode&utm_medium=feed)

Keep a max-heap for the lower half and a min-heap for the upper half. The median lives at the boundary.

15 min read · [abstractalgorithms.hashnode.dev](https://abstractalgorithms.hashnode.dev/two-heaps-pattern?utm_source=hashnode&utm_medium=feed)

[Kanchan Rai](https://hashnode.com/@kanchanraiii) · [Dec 10, 2024](https://hashnode.com/posts/day-21-100-days-of-dsa/6758525e622cde8b84e853c4)

### [Day 21: 100 Days of DSA](https://kanchanraiii.hashnode.dev/day-21-100-days-of-dsa?utm_source=hashnode&utm_medium=feed)

Heap

6 min read · [kanchanraiii.hashnode.dev](https://kanchanraiii.hashnode.dev/day-21-100-days-of-dsa?utm_source=hashnode&utm_medium=feed)

[Bonaventure Ogeto](https://hashnode.com/@bonaogeto) · [Oct 16, 2024](https://hashnode.com/posts/introduction-to-heaps-max-heap-vs-min-heap-2024-guide-day-15/6710295dc2706a2cd39976d7)

### [Introduction to Heaps - Max Heap vs Min Heap \[2024\] Guide | Day #15](https://hojaleaks.com/introduction-to-heaps-max-heap-vs-min-heap-2024-guide-day-15?utm_source=hashnode&utm_medium=feed)

Learn implementation, operations, and practical applications with Python and JavaScript examples. Perfect for developers and coding interviews

4 min read · [hojaleaks.com](https://hojaleaks.com/introduction-to-heaps-max-heap-vs-min-heap-2024-guide-day-15?utm_source=hashnode&utm_medium=feed)

[Rohit Gawande](https://hashnode.com/@rohit253) · [Sep 4, 2024](https://hashnode.com/posts/chapter-32-heaps/66d872a289ca0a0c1f92fccc)

### [Chapter 32: Heaps(Alpha Plus Batch (Apna College)](https://rohitgawande.dev/chapter-32-heaps?utm_source=hashnode&utm_medium=feed)

Introduction to Priority Queues and Heaps Introduction to Priority Queues (PQ) A Priority Queue (PQ) is a specialized type of queue where each element is assigned a priority. Elements with higher priority are processed before those with lower priorit...

19 min read · [rohitgawande.dev](https://rohitgawande.dev/chapter-32-heaps?utm_source=hashnode&utm_medium=feed)

[Vineeth Chivukula](https://hashnode.com/@vineethchivukula) · [Jul 11, 2024](https://hashnode.com/posts/solving-find-median-from-data-stream/668fd0796d466b1a2fd58982)

### [Solving Find Median from Data Stream](https://vineethchivukula.hashnode.dev/solving-find-median-from-data-stream?utm_source=hashnode&utm_medium=feed)

To see the question, click here. Naive Approach The idea is to store the elements in a list. At each stage of adding an element, we will sort the list because the elements may not be added to the list in a sorted fashion. // TC: O(nlogn) for addNum a...

5 min read · [vineethchivukula.hashnode.dev](https://vineethchivukula.hashnode.dev/solving-find-median-from-data-stream?utm_source=hashnode&utm_medium=feed)

[Vineeth Chivukula](https://hashnode.com/@vineethchivukula) · [Jul 9, 2024](https://hashnode.com/posts/understanding-java-heaps-for-dsa/668c84a69e2b7b3cf39ce84d)

### [Understanding Java Heaps for DSA](https://vineethchivukula.hashnode.dev/understanding-java-heaps-for-dsa?utm_source=hashnode&utm_medium=feed)

In Java, heaps are typically implemented using the PriorityQueue class, which is part of the java.util package. A heap is a specialized tree-based data structure that satisfies the heap property. The PriorityQueue class provides an implementation of ...

2 min read · [vineethchivukula.hashnode.dev](https://vineethchivukula.hashnode.dev/understanding-java-heaps-for-dsa?utm_source=hashnode&utm_medium=feed)

[Vineeth Chivukula](https://hashnode.com/@vineethchivukula) · [Jun 25, 2024](https://hashnode.com/posts/understanding-two-heaps/667acba2da4a050323f2f3a5)

### [Understanding Two Heaps](https://vineethchivukula.hashnode.dev/understanding-two-heaps?utm_source=hashnode&utm_medium=feed)

Two Heaps is a pattern used to solve problems that involve maintaining a dynamic set of elements with the ability to find the median, the smallest or largest elements efficiently, or to balance two sets of elements. This pattern typically involves us...

2 min read · [vineethchivukula.hashnode.dev](https://vineethchivukula.hashnode.dev/understanding-two-heaps?utm_source=hashnode&utm_medium=feed)
