+1 vote
in Data Structures & Algorithms I by (88.2k points)
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 I

I got this question in final exam.

1 Answer

+1 vote
by (737k points)
selected by
 
Best 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).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...