✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Si denota el número de nodos del árbol de entrada, ¿cuál es el coste en tiempo de la función sum_nodes?
int sum_nodes(const BinTree &tree) {
if (tree.empty()) {
return 0;
} else {
return tree.root() + sum_nodes(tree.left()) + sum_nodes(tree.right());
}
}