Tag: priority queue
-
Priority queue min heap implementation in JavaScript
Here’s what I’ve learned about the heap data structure. The invariant of the min/max heap is this: when represented in a binary tree, the parent node’s value is always smaller/bigger than or equal to its children. The root is always the smallest/biggest value of the heap when represented as a binary tree. The two most…