✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Partimos de la siguiente función
void mi_funcion(const BinTree &t) {
if (t.empty()) {
// No hacemos nada
} else {
mi_funcion(t.left());
mi_funcion(t.right());
g(t.left());
g(t.right());
}
}
Si suponemos que el árbol de entrada t está equilibrado y que tiene tamaño , y que la función g() tiene coste en tiempo lineal con respecto al tamaño del árbol que recibe como parámetro. ¿Cuál es el orden de complejidad de esta función?