Examveda

Consider the pseudo 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
Does the above code can check if a binary search tree is an AVL tree?

A. yes

B. no

Answer: Option A


This Question Belongs to Data Structure >> Binary Search Trees(B Tree)

Join The Discussion

Related Questions on Binary Search Trees(B Tree)