• recategorized by
215 views

1 Answer

0 0 votes

In A Binary Heap, 

Deleted a root element takes O(1), But to re-adjust other nodes according to the rules takes O(Logn).

Inserting in a Binary Heap takes O(logn ) as the element inserted might have to be bubbled all the way till the Binary heap's height which is Logn.

For searching in a Binary heap, It is not possible within Logn time as it doesnot follow any relation between  other nodes or subtrees but only with immediate children and parent. So it will take O(n) time.

So answer is option C, Both A and B.

 

Answer:
Position:
Show:

Related questions

1 1 vote
0 0 answers
228
228 views
Shubham Sharma 2 asked Jul 24, 2025
228 views
Which of the following is the primary property of a binary heap?The parent node is greater than its children (max-heap).The parent node is less than its children (min-hea...
1 1 vote
0 0 answers
146
146 views
Shubham Sharma 2 asked Jul 24, 2025
146 views
What is the time complexity for searching an element in a balanced Binary Search Tree?$\text{O}(1)$$\text{O}(\log n)$$\text{O}(n)$$\text{O}(n \log n)$ 
2 2 votes
1 1 answer
228
228 views
Shubham Sharma 2 asked Jul 24, 2025
228 views
Which of the following is the primary operation for adding an element to a queue in $\text{C}?$EnqueueDequeuePushPop
2 2 votes
1 1 answer
201
201 views
Shubham Sharma 2 asked Jul 24, 2025
201 views
Which traversal method can be used to print the nodes of a binary tree in ascending order?Pre-order traversalPost-order traversalIn-order traversalLevel-order traversal