Question: Assume that a tree is represented by X , lef t ( X ) , right ( X ) and possibly other satellite data that
Assume that a tree is represented by X lef tX rightX and possibly
other satellite data that we ignore. A tree is called an AVL tree if for every subtree
rooted at X the absolute value of the height difference between the left subtree and
the right subtree is at most Specifically, if hL is the height of lef tX and hR is the
height of rightX then hL hR
Give an algorithm that checks if a tree is an AVL tree.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
