Recent questions tagged avl-tree

10 10 votes
1 1 answer
587
587 views
6 6 votes
1 1 answer
417
417 views
Given the following AVL tree, delete node $\text{A}$.How many rotations are required to rebalance the AVL tree after deleting node $A$?(Count each rotation only once, whe...
7 7 votes
1 1 answer
244
244 views
Insertion of a new element into an AVL tree may violate the AVL balance condition. Usually, we perform a rotation at the first node on the path from the inserted element ...
7 7 votes
1 1 answer
251
251 views
Consider the following AVL tree:First insert $10$ into the AVL tree. Then delete $28$ from the resulting AVL tree.What is the root of the AVL tree after both operations?$...
6 6 votes
1 1 answer
223
223 views
Given the following AVL tree, delete the key $1$ and rebalance the tree. What will be the root of the final AVL tree after deletion and rebalancing?$7$ $10$ $15$ $3$
6 6 votes
1 1 answer
243
243 views
For the following three trees, choose the correct classification.Tree (a):Tree (b):Tree (c):Which option is correct?All three are valid AVL trees. Tree (a) is not a valid...
6 6 votes
1 1 answer
220
220 views
What is the time complexity for efficiently finding an arbitrary item in an arbitrary AVL tree of $n$ nodes?$\Theta(n)$ $\Theta(\log_2 n)$ $\Theta(n \log_2 n)$ $\Theta(n^...
7 7 votes
1 1 answer
307
307 views
Which statement is true for AVL trees?Adding a node may cause the tree to increase in height. Adding a node will cause the tree to increase in height. Adding a node may c...
5 5 votes
1 1 answer
251
251 views
We have just inserted $51$ into the following AVL tree. Rebalance the tree.What is the root of the AVL tree after rebalancing?$35$ $42$ $47$ $57$
5 5 votes
2 2 answers
279
279 views
Given a binary min-heap storing $n$ comparable keys, can we always build a Set AVL Tree containing the same keys using only $O(n)$ comparisons?True False
1 1 vote
0 0 answers
408
408 views
In how many ways we can insert the elements {1, 2, . . . , 7} into an empty AVL tree so that we don‟t have to perform any rotations on it?
3 3 votes
1 1 answer
611
611 views
Which of the following trees are height balanced?Binary Search TreeAVL TreeRed-Black TreeB TreeChoose the correct answer from the options given below:$\text{I}$ and $\tex...
2 2 votes
1 1 answer
542
542 views
Which of the following description(s) is/are true:Red Black Tree - Guarantees worst case of $\mathrm{O}(\log \mathrm{n})$ time for search, insert \& delete.Trie - Used fo...
2 2 votes
3 3 answers
408
408 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...
2 2 votes
2 2 answers
564
564 views
The minimum number of nodes in AVL tree with height $ H $ is ________ .$ Note : $ Assume Height of Tree with Single node is $ 0 $.
1 1 vote
1 answers 1 answer
507
507 views
C4. Consider two binary search trees (\(BSTs\)) named \(T_1\) and \(T_2\), rooted at \(Root_1\) and \(Root_2\), respectively. Both \(T_1\) and \(T_2\) are \(AVL\) (Adelso...
1 1 vote
1 1 answer
586
586 views
Given below are two statements: one is labelled as Assertion $\mathrm{A}$ and the other is labelled as Reason $\mathrm{R}$.Assertion $\mathrm{A}$: The AVL trees are more ...
1 1 vote
1 1 answer
1.2k
1.2k views
Suppose a BST is converted into an AVL tree. Which of the following statements is correct?a. The in-order traversal of the AVL tree and the BST will be the same.b. The pr...
0 0 votes
1 1 answer
1.7k
1.7k views
S1 : An insertion in an AVL with n nodes requires O(n) rotations.answer is false in answer key,but is guess for 1 insetion its O(1).so for n it will be O(n).tell me if i ...
23 23 votes
2 2 answers
3.0k
3.0k views
Shown Below is an AVL tree. Suppose all keys are distinct and integers.How many keys in the range $20<x<50$ that would require rotation upon insertion?