–tags: Data Structures

Heap:

Used in sorting algorithms Binary tree not BST but binary tree Rules: Balanced always Left to right top to bottom Minheap or maxheap? Lowest or highest value at the top of heap First left child node is placed first Swapping of the min or max value management keeps a heap sorted Not fully sorted data structure: Min or max value is always at the top High priority is bubbled at the top which is its primary function rather than retrieving values

Support: CFbinaryheap in Objective C Class PriorityQueue in Java