Start learning 50% faster. Sign in now
An AVL tree is a self-balancing binary search tree where the balance factor of each node (height difference between the left and right subtrees) is kept between -1 and +1. When the balance factor becomes +2 or -2 after an insertion, the tree violates this property and must be rebalanced using rotations. The type of rotation depends on the imbalance: • Single Rotation: Used when the imbalance is in one direction, either left-heavy (LL rotation) or right-heavy (RR rotation). • Double Rotation: Used when the imbalance involves opposite directions, such as left-right (LR rotation) or right-left (RL rotation). Option 2 is correct because the AVL tree algorithm always rebalances the tree after insertion using rotations to ensure logarithmic height. Why Other Options Are Incorrect: 1. Tree becomes unbalanced and cannot be used: Incorrect, as AVL trees are explicitly designed to handle imbalances. 2. Insertion is rejected: Incorrect, as rebalancing is performed instead of rejecting insertions. 3. Height increases by 2: Incorrect, as height adjustments depend on rebalancing and typically increase by at most 1. 4. Balance factor is ignored: Incorrect, as the balance factor is central to maintaining AVL tree properties.
A and B started a business investing Rs. 1500 for ‘x’ months and Rs. 1800 for 10 months, respectively. Out of total profit of Rs. 5000, profit shar...
Average of four numbers is 16. Sum of smallest and largest number is 48. If difference between other two numbers is 2, then find the square of second sm...
The average age of a group of 70 students is 13 years. If 3 students whose ages are 15 years, 21 years, and _____ years are replaced by 3 new students w...
The average of five even numbers is 36. If we replace two of these even numbers, 82 and 88, with a single even number X, the new average decreases by 4....
3 years ago, the average age of a family of 5 members was 17 years. A baby being born, the average age of the family is 17 years. The present age of the...
The average weight of five friends A, B, C, D and E is (x+8) years while the average weight of C and E is (x-8) kg. If the weight of another person F is...
The average of five numbers is 30. If one of the numbers is removed, the average becomes 25. What is the number that was removed?
In a cricket match the captain of one of a team scored 25 runs more than the average runs scored by the remaining 8 batsmen of that team who batted in t...
The average of 10 numbers is 18. When two new numbers 'a' and 'b' are added, the average increases by 2. If a - b = 30, find the value of b.
The average number of books sold by Viren in first 5 months is 3500 and in first 6 months is 4300. If the number of books sold by him in 7th ...