Posts Tagged Data Structures

Heap and Priority Queue 101


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