Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Recurso 2008
- Determinar, de modo recursivo, o número de nós intermédios, tendo pelo menos um descendete.
- */
- int NumInterm(PtABPNode proot){
- if(proot == NULL) return 0;
- if(proot->PtLeft != NULL || proot->PtRight != NULL) return 1 + NumInterm(proot->PtLeft) + NumInterm(proot->PtRight);
- else return NumInterm(proot->PtLeft) + NumInterm(proot->PtRight);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement