Data Structure Questions and Answers-AVL Tree
Click on any option to know the CORRECT ANSWERS
What is an AVL tree?
a tree which is balanced and is a height balanced tree
a tree which is unbalanced and is a height balanced tree
a tree with three children
a tree with atmost 3 children
Question 1 Explanation:
It is a self balancing tree with height difference atmost 1.
Why we need to a binary tree which is height balanced?
to avoid formation of skew trees
to save memory
to attain faster memory access
to simplify storing
Question 2 Explanation:
In real world dealing with random values is often not possible, the probability that u are dealing with non random values(like sequential) leads to mostly skew trees, which leads to worst case. hence we make height balance by rotations.
Which of the below diagram is following AVL tree property?
only i and ii
none of the mentioned
Question 3 Explanation:
The property of AVL tree is it is height balanced tree with difference of atmost 1 between left and right subtrees.
What is the maximum height of an AVL tree with p nodes?
Question 4 Explanation:
Consider height of tree to be 'he', then number of nodes which totals to p can be written in terms of height as N(he)=N(he-1)+1+N(he-2). since N(he) which is p can be written in terms of height as the beside recurrence relation which on solving gives N(he)= O(logp) as worst case height.
To restore the AVL property after inserting a element, we start at the insertion point and move towards root of that tree. is this statement true?
Question 5 Explanation:
It is interesting to note that after insertion, only the path from that point to node or only that subtrees are imbalanced interms of height.
There are 5 questions to complete.