Question
In an AVL tree, what happens if a node insertion causes
the balance factor of a node to become +2 or -2?Solution
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.
47.87% of 749.76 + 35.11% of 399.76 = β? + 23.15 Γ 20.87
- What approximate value will come in place of the question mark (?) in the following question? (Note: You are not expected to calculate the exact value.)
(?)2 = (5.99)2 + (7.88)2 + 43.99

Train 'P' travels at a speed of 45 km/h and crosses train 'Q' in 15 seconds while moving in opposite directions. Determine the speed of train 'Q' if the...
`[(7.99)^2 - (13.001)^2 + (4.01)^3]^2=` ?
A number is first increased by 35% and then decreased by 35%. If the net change in the number is 302.5, then find the original number.
A bag contains red, green, and blue balls, with a total of 16 balls. The probability of drawing two blue balls in one draw is 3/8. How many blue balls a...
35.05% of 14.87 Γ (13.02 β ?) + 30.19 = 188.7
What approximate value will come in place of the question mark (?) in the following question? (Note: You are not expected to calculate the exact value.)...