Posts Tagged Data Structures

Heap and Priority Queue 101

Heap

Heap: A heap is a partially ordered tree, typically a binary tree. Heaps use the index starting typically from ‘i’.
When represented as an array, the parent element can be found at i/2, left child at 2*i, right child at 2 *i+1, where ā€˜i’ is the index of the location.
A ā€˜N’ element heap contains...

BTC Prices