Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static bool i_buscar(node_arbreGen* n, const T& x){
- if (n == NULL){
- return false;
- } else {
- if (n->info == x) return true;
- else {
- int i = 0;
- bool ok = false;
- while (i < n->seg.size() and not ok){
- if (i_buscar(n->seg[i],x)) ok = true;
- else i++;
- }
- return ok;
- }
- }
- }
- bool buscar(const T& x) const
- /* Pre: cert */
- /* Post: el resultat indica si x es troba al p.i. o no */
- {
- return i_buscar(primer_node, x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement