Heap Data Structure

1. Introduction

Binary Heap Representation diagram
MinHeap T.C. MaxHeap T.C.
Heap Construction O(n) Heap Construction O(n)
getMin() O(1) getMax() O(1)
extractMin() O(log N) extractMin() O(log N)
decreaseKey() O(log N) decreaseKey() O(log N)
insert() O(log N) insert() O(log N)
delete() O(log N) delete() O(log N)
polling() O(log N) polling() O(log N)
removing() O(N) removing() O(N)

------ End ------