Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function t_height(t)
- {
- var cur,n=0,hl,hr;
- if(t.root==null){return 0;}
- cur=t.root; if(cur.left!=null && cur.right!=null)
- {n++;}
- else {return n;}
- hl=t_height(t.left);
- h2=t_height(t.right);
- if(hl>hr){return hl;}
- else{return hr;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement