Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static T i_max_suma_cami(node_arbreGen* n){
- T max = 0;
- if (n != NULL){
- max = n->info;
- T aux1 = 0;
- for (int i = 0; i < n->seg.size(); i++){
- T aux2 = i_max_suma_cami(n->seg[i]);
- if (aux2 > aux1) aux1 = aux2;
- }
- max += aux1;
- }
- return max;
- }
- T max_suma_cami() const
- /* Pre: el parametre implicit no es buit */
- /* Post: el resultat es la suma del cami de suma maxima del parametre implicit */
- {
- return i_max_suma_cami(primer_node);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement