Heap Operation Complexity
Heap insertion takes O(log n) because the new element is initially placed at the end and may bubble up along the height of the heap. Removing the root also takes O(log n): the last element replaces the root and is then sifted down. Since a heap is complete, its height is O(log n).
Peek: O(1).
Insertion: O(log n).
Delete-min/delete-max: O(log n).
Search for an arbitrary value: O(n) in the general case.
Heap height is O(log n) because the tree is complete.