Phạm Quyết
New member
Consider the pseudo code:
Does the above code can check if a binary search tree is an AVL tree?
A. yes
B. no
Code:
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
A. yes
B. no