Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int subtree(link root1, link root2){
- int uguali;
- if (KEYcmp(root1->key, root2->key)==0){ //se uguali
- uguali = 1;
- if (root1->l != NULL){
- uguali = subtree(root1->l, root2->l); //aggiunto 1 che mancava
- }
- else
- return uguali;
- if (root1->r != NULL){ //aggiunto 1 che mancava
- uguali = subtree(root1->r, root2->r);
- }
- else
- return uguali;
- }
- else{ //se diversi
- uguali = 0;
- if(root1->l != NULL){
- uguali = subtree(root1->l, root2);
- }
- else
- return uguali;
- if (root1->r != NULL){
- uguali = subtree(root1->r, root2);
- }
- else
- return uguali;
- }
- return uguali;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement