• recategorized by
566 views

1 Answer

0 0 votes
I think,
a. O(n^2)
b. O(nlogn)
Position:
Show:

Related questions

2 2 votes
1 1 answer
991
991 views
eyeamgj asked Jun 19, 2018
991 views
Given two inputs bst and min heap tree with $n$ nodes .To get the sorted order which is better and how much time?In the solution for min heap they first used build heap t...
2 2 votes
3 3 answers
386
386 views
Shubham Sharma 2 asked Sep 9, 2025
386 views
Which of the following is $\text{TRUE}?$The cost of searching an AVL tree is $\theta(\log n)$ but that of binary search is $0(n)$The cost of searching an AVL tree in $\th...
1 1 vote
0 0 answers
145
145 views
Shubham Sharma 2 asked Jul 24, 2025
145 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
468
468 views
Shubham Sharma 2 asked Jun 12, 2025
468 views
Let $R$ be the root of a balanced binary search tree having $n$ nodes, where each node contains an integer, a pointer to its left child and a pointer to its right child. ...