Heap

Heapsort

A sorting technique that uses a binary heap, first building a max-heap and then repeatedly extracting the maximum element, ensuring efficient sorting.

  • Time complexity is Linearithmic, i.e. O(n log(n))
  • Space complexity is Constant, i.e. O(1)

Huffman Encoding

The Huffman Encoding data structure uses a Min Heap to sort characters by frequency. It then assigns codes based on frequency; the most frequent characters will have the shortest codes.

Minimum Heap

The Minimum Heap is a specialized binary tree that is based on the Heap data structure. It is also known as a Priority Queue.