MCQ
Q.
Consider the pseudo code below.
Does the below code can check if a binary search tree is an AVL tree?
Does the below code can check if a binary search tree is an AVL tree?
int avl(binarysearchtree root):
if(not root)
return 0
left_tree_height = avl(left_of_root)
if(left_tree_height== -1)
return left_tree_height
right_tree_height= avl(right_of_root)
if(right_tree_height==-1)
return right_tree_height
Correct Answer: A
None.