1.

What is the time complexity for increasing priority of key in a minimum ternary heap of n elements?(a) O (log n/ log 3)(b) O (3log n/ log 3)(c) O (n)(d) O (1)This interesting question is from Ternary heap topic in section Heap of Data Structures & Algorithms II had been asked this question by my school principal while I was bunking the class.

Answer»

The correct answer is (b) O (3LOG n/ log 3)

Explanation: In order to the INCREASING the priority of key in a minimum ternary heap data structure having n elements, it performs downward swapping. So the time COMPLEXITY for WORST case is found to be O (3log n/ log 3).



Discussion

No Comment Found

Related InterviewSolutions