The Height of Balanced Binary Trees

Q: What is the height of a balanced binary tree of size n?

n = 2h + 1 − 1
n + 1 = 2h + 1
log2(n + 1) = log2(2h + 1)
log2(n + 1) = h + 1
h = log2(n + 1) - 1
h = O(log(n))

Therefore, the time it takes to do adds and removes in a binary heap is O(log(n)) (logarithmic), where n is the number of nodes in the heap.