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)?
Asked
Active
Viewed 1,131 times
1 Answers
1
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.

arunkumaraqm
- 337
- 1
- 13