What is the time complexity for creating a ternary heap using swapping?

Category: QuestionsWhat is the time complexity for creating a ternary heap using swapping?
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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).


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40701