Posts

Heap and Tries

Introduction Everything that I wrote here is based on my knowledge and therefore are unbounded by any copyright. Heap What is heap? Heap is basically a data structure which implements the binary tree or to be precise, a complete binary tree to store it's data in a certain way. There are four kinds of heap : 1) Max Heap which always store the maximum value at it's root node and every parent node must has a greater or equal to it's child node value. 2) Min Heap which as opposed to Max Heap, will always store the minimum value at it's root node and every parent node must has a smaller or equal value to it's child node value. 3) Min-Max Heap which stores the minimum value at it's even level node and maximum value at it's odd level node. 4) Max-Min Heap which as opposed to Min-Max Heap, stores the maximum value at it's even level node and minimum value at it's even level node. Insertion on a Heap data structure Now, ...