Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. int subtree(link root1,link root2){
  2. int n;
  3. if(root1==NULL && root2==NULL){
  4. return 1;
  5. }
  6. if((root1!=NULL && root2==NULL)|| (root1==NULL && root2!=NULL)){
  7. return 0;
  8. }
  9.  
  10. if(keyCompare(root1->key,root2->key)==0){
  11. n=subtree(root1->figliosx,root2->figliosx);
  12. if(n==0)
  13. return 0;
  14. n=subtree(root1->figliodx,root2->figliodx);
  15. if(n==0)
  16. return 0;
  17. }
  18. else{
  19. n=subtree(root1->figliosx,root2);
  20. if(n==1) return 1;
  21. return(subtree(root1->figliodx,root2));
  22. }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement