+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is the time complexity for creating a ternary heap using swapping?

(a) O (log n/ log 3)

(b) O (n!)

(c) O (n)

(d) O (1)

The question is from Ternary heap in chapter Heap of Data Structures & Algorithms I

The question was posed to me in class test.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct answer is (c) O (n)

The explanation is: Ternary Heap can be formed by two swapping operations. Therefore, the time complexity for creating a ternary heap using two swapping operation is found to be O (n).

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

...