What is the time complexity for deleting root key in a ternary heap of n elements?

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

What is the time complexity for deleting root key in a ternary heap of n elements?
 
(a) O (log n/ log 3)
 
(b) O (3log n/ log 3)
 
(c) O (n)
 
(d) O (1)
 
I need to ask this question from Ternary heap topic in portion Heap of Data Structures & Algorithms I
 
This question was posed to me in a job interview.

1 Answers
Editor">Editor Staff answered 5 months ago

The correct option is (b) O (3log n/ log 3)
 
The explanation is: In order to delete a root key in a ternary heap data structure having n elements, it performs downward swapping. So the time complexity for worst case is found to be O (3log n/ log 3).


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