The heap data structure

A sample implementation of the heap data structure is at:

https://github.com/Khanna111/DS/tree/master/Heap/src/com/khanna111

You would find two classes that implement the “siftDown” approach that creates a heap from an input array of “n” elements in O (n) complexity.

For details on the “siftDown” approach and the complexity being O (n), please refer to:

http://en.wikipedia.org/wiki/Heapsort