1.

What is the time complexity for inserting a new item in a ternary heap of n elements?(a) O (log n/ log 3)(b) O (n!)(c) O (n)(d) O (1)The query is from Ternary heap in portion Heap of Data Structures & Algorithms II got this question in final exam.

Answer»

The CORRECT answer is (a) O (log n/ log 3)

Best EXPLANATION: In order to insert a new item in a TERNARY HEAP data structure having n elements, the heap has great efficiency for inserting them. So the time complexity for worst CASE is found to be O (log n/ log 3).



Discussion

No Comment Found

Related InterviewSolutions