Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pair<bool, string> Esquema::i_buscarAreaTematica2 (Arbre<string> &a, Revista& r) {
- pair<bool, string> p;
- if (a.es_buit()) {
- p.first = false;
- //cout << "Es buit" << endl;
- }
- else if (r.esPC((a.arrel()))) {
- p.first = true;
- p.second = a.arrel();
- }
- else {
- string arrel = a.arrel();
- //cout << "Else: "<<endl;
- Arbre<string> a1, a2;
- a.fills(a1, a2);
- pair<bool, string> p1, p2;
- p1 = i_buscarAreaTematica2 (a1, r);
- p2 = i_buscarAreaTematica2 (a2, r);
- if (p1.first and not p2.first) {
- p.first = true;
- p.second = p1.second;
- }
- else if (not p1.first and p2.first) {
- p.first = true;
- p.second = p2.second;
- }
- else if (p1.first and p2.first) {
- p.first = true;
- p.second = arrel;
- }
- else
- p.first = false;
- }
- return p;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement