Advertisement
Guest User

Untitled

a guest
May 29th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. int h(node *root)
  2.  
  3.  {   if(!root)
  4.         return 0;
  5.     return 1 + max(h(root->left),h(root->right));
  6. }
  7. void printdlin(const node * p)
  8.  
  9. {
  10.     if(p!=NULL)
  11.     {
  12.         if(h(p->left)>h(p->right))
  13.  
  14.  printdlin(p->left);
  15.         else
  16. printdlin(p->right);
  17.                 }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement