Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Arbre.hh"
- using namespace std;
- bool quasi_coincidents2(Arbre<int> &a, Arbre<int> &b, bool &quasi){
- bool f;
- if((a.es_buit() and not b.es_buit()) or (not a.es_buit() and b.es_buit())){
- if(quasi) f = false;
- else if(not quasi){
- if (not b.es_buit()) {
- Arbre <int> auxb(b);
- Arbre<int> b1;
- Arbre<int> b2;
- auxb.fills(b1,b2);
- if (b1.es_buit() and b2.es_buit()) f = true;
- else f = false;
- }
- else if (not a.es_buit()) {
- Arbre <int> auxa(a);
- Arbre<int> a1;
- Arbre<int> a2;
- auxa.fills(a1,a2);
- if (a1.es_buit() and a2.es_buit()) f = true;
- else f = false;
- }
- quasi = true;
- }
- }
- else if(a.es_buit() and b.es_buit()) f = true;
- else {
- Arbre<int> a1;
- Arbre<int> a2;
- Arbre<int> b1;
- Arbre<int> b2;
- a.fills(a1,a2);
- b.fills(b1,b2);
- f=quasi_coincidents2(a1,b1, quasi);
- if(f) f=quasi_coincidents2(a2,b2, quasi);
- }
- return f;
- }
- bool quasi_coincidents(Arbre<int> &a, Arbre<int> &b){
- bool quasi=false;
- return quasi_coincidents2(a, b, quasi);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement