Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Esquema::i_buscarAreaTematica1 (Arbre<string> &a, Revista& r, list<string>& l, string& n, int& count) {
- bool p;
- if (a.es_buit()) {
- p = false;
- }
- else if (r.esPC(a.arrel())) {
- ++count;
- }
- else {
- n = a.arrel();
- Arbre<string> a1, a2;
- a.fills(a1,a2);
- bool p1, p2;
- list<string> l1, l2;
- string n1,n2;
- int count1 =0, count2 = 0;
- p1 = i_buscarAreaTematica1 (a1, r, l1, n1, count1);
- //cout << "l1: "<< l1.size() << endl;
- p2 = i_buscarAreaTematica1 (a2, r, l2, n2, count2);
- // cout << "l2: "<< l2.size() << endl;
- //Cas coincident els dos tenen totes les pcs
- if ((l1.size() >= r.longitudPalabrasClave()) and (l1.size() > 1) and (l2.size() >= r.longitudPalabrasClave())) {
- if (r.esPC(n1) or r.esPC(n2)) {
- list<string>::iterator it;
- it = l.begin();
- l.insert(it, n);
- }
- else if (p1 and p2) {
- list<string>::iterator it;
- it = l.begin();
- if (n1 < n2)
- l.insert(it, n1);
- else
- l.insert(it, n2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement