Question #90855

write a c++ function which finds and returns the smallest node in binary search tree using recursion

Expert's answer

node* getSmallest(node* n) 
{        
  if (n == NULL)
    return NULL;        
  else if (n -> left == NULL)            
    return n;        
  else            
    return getSmallest(n -> left);    
}
LATEST TUTORIALS
APPROVED BY CLIENTS