Advertisement
jonator

Untitled

Nov 28th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pair<bool, string> Esquema::i_buscarAreaTematica2 (Arbre<string> &a, Revista& r) {
  2.     pair<bool, string> p;
  3.     if (a.es_buit()) {
  4.       p.first = false;
  5.       //cout << "Es buit" << endl;
  6.     }
  7.     else if (r.esPC((a.arrel()))) {
  8.       p.first = true;
  9.       p.second = a.arrel();
  10.     }
  11.     else {
  12.       string arrel = a.arrel();
  13.       //cout << "Else: "<<endl;
  14.       Arbre<string> a1, a2;
  15.       a.fills(a1, a2);
  16.       pair<bool, string> p1, p2;
  17.       p1 = i_buscarAreaTematica2 (a1, r);
  18.       p2 = i_buscarAreaTematica2 (a2, r);
  19.       if (p1.first and not p2.first) {
  20.     p.first = true;
  21.     p.second = p1.second;
  22.       }
  23.       else if (not p1.first and p2.first) {
  24.     p.first = true;
  25.     p.second = p2.second;
  26.       }
  27.       else if (p1.first and p2.first) {
  28.     p.first = true;
  29.     p.second = arrel;
  30.       }
  31.       else
  32.     p.first = false;
  33.     }
  34.     return p;
  35.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement