Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int subtree(link root1,link root2){
- int n;
- if(root1==NULL && root2==NULL){
- return 1;
- }
- if((root1!=NULL && root2==NULL)|| (root1==NULL && root2!=NULL)){
- return 0;
- }
- if(keyCompare(root1->key,root2->key)==0){
- n=subtree(root1->figliosx,root2->figliosx);
- if(n==0)
- return 0;
- n=subtree(root1->figliodx,root2->figliodx);
- if(n==0)
- return 0;
- }
- else{
- n=subtree(root1->figliosx,root2);
- if(n==1) return 1;
- return(subtree(root1->figliodx,root2));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement