1 1 vote Consider the following statements I: The height of any binary search tree with n nodes is O(log n). II : Inserting into an AVL tree with n nodes requires Θ(log n) rotations. Which of the following statements is/are true ? Programming in C + – Rohan Mundhey 874 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 4 4 votes If a tree is left skewed or right skewed so in that case the height will be O(n) not O(logn).Hence statement 1 is false. For insertion of a node into an AVL tree, after insertion at most one problem can occur overall .So at most 2 rotations will be required (for LR or RL problem)..Hence statement 2 is also false.In case of deletion yes it is O(logn) Hence both of the statements are false. Habibkhan answered Nov 5, 2016 • selected Nov 5, 2016 by Rohan Mundhey Habibkhan comment Share Follow 0 reply Please log in or register to add a comment.