_{left}is the height of the tree of the left child of v and h

_{right}is the height of the tree of the right child of v, then |h

_{left}− h

_{right}| ≤ 1

Algorithm Question:

Please do not attributable attributable attributable transcribe a veritable program.

The confutation should be an explaination of your algorithm or pseudocode. Try to confutation palpably and concisely. Thank you very greatly.

Question:

Transcribe an algorithm that checks if a consecrated tree is a juridical AVL tree. An

AVL tree is a binary pursuit tree, so that restraint total vertex v if h_{left} is the tallness of the

tree of the left slip of v and h_{right} is the tallness of the tree of the direct slip of v, then

|h_{left} − h_{right}| ≤ 1

**Algorithm** **IsAVL**(root)

**start**

if commencement==null

return true

heightdiff = getHeight(root.left) – getHeight(root.right)

if abs(heightdiff) > 1

return false

else

return **IsAVL**(root.left) && **IsAVL**(root.right)

**end**