How insert operation has an amortized time of O(1) in binomial heap?

1.5k views Asked by At

Wikipedia says that the insert operation in binomial heap has an amortized time of O(1). For a single insert operation the time complexity is O(log n). But how its amortised time becomes O(1)?

1

There are 1 answers

0
arunkumaraqm On

A single insert operation only takes log n time when your root list has trees of ranks 1, 2, 3, ..., m (none missing in between) where m is the rank of the largest tree. Every binomial heap's root list can be expressed as a binary no. If the binomial heap looks like 11111 and you insert a node, then it becomes 100000. But, you won't have that many carries the next few times that you insert nodes.