What is the time complexity for decreasing priority of key in a minimum ternary heap of n elements?

Category: QuestionsWhat is the time complexity for decreasing priority of key in a minimum ternary heap of n elements?
Editor">Editor Staff asked 5 months ago

What is the time complexity for decreasing priority of key in a minimum ternary heap of n elements?
 
(a) O (log n/ log 3)
 
(b) O (n!)
 
(c) O (n)
 
(d) O (1)
 
Enquiry is from Ternary heap topic in section Heap of Data Structures & Algorithms I
 
I have been asked this question during an online interview.

1 Answers
Editor">Editor Staff answered 5 months ago

The correct option is (a) O (log n/ log 3)
 
Explanation: In order to decrease the priority of an item in a ternary heap data structure having n elements, the heap has great efficiency for decreasing them. So the time complexity for worst case is found to be O (log n/ log 3). This is due to the upwards swapping process.


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: 40702