Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Recurso 2008
  3.  
  4. Determinar, de modo recursivo, o número de nós intermédios, tendo pelo menos um descendete.
  5.  
  6. */
  7.  
  8.  
  9. int NumInterm(PtABPNode proot){
  10.     if(proot == NULL) return 0;
  11.  
  12.     if(proot->PtLeft != NULL || proot->PtRight != NULL) return 1 + NumInterm(proot->PtLeft) + NumInterm(proot->PtRight);
  13.     else return NumInterm(proot->PtLeft) + NumInterm(proot->PtRight);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement