Deleting the root of a heap
- Cite this article as:
- Doberkat, E.E. Acta Informatica (1982) 17: 245. doi:10.1007/BF00264353
- 41 Downloads
The average behavior of the familiar algorithm for root deletion is considered, when every heap has the same probability to occur. The analysis centers around the notion of a viable path in the tree representation, i.e. such a path the label which replaces the label of the root may be allowed to travel when the heap is reconstructed. In case the size of the heap is a power of 2 it is shown that both the expected number of comparisons and of interchanges are asymptotically equal to the respective numbers in the worst case.