Skip to content
SparkTime, home
Tag · 1 piece

#heaps

Tagged #heaps

GuideTechnology

21 min read

Heaps and Priority Queues

How a heap keeps the smallest or largest item ready in O(1), how insert and remove work in O(log n), how to use Java's PriorityQueue, and how to solve top-K, k-th largest and merge-k-sorted problems. Includes how a heap differs from a BST.