Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @brief EJERCICIO 3 - Carga un elemento en un ABB
- * @param arbolito ArbolBin<T>
- * @param e T
- */
- template <class T>
- void cargarABB(ArbolBin<int> &arbolito, T e) {
- Nodo<int>** R = arbolito.raizArbol();
- while (*R) {
- if (arbolito.recuperar(*R) == e)
- return;
- else {
- if (arbolito.recuperar(*R) > e)
- R = arbolito.hijoIzq(*R);
- else
- R = arbolito.hijoDer(*R);
- }
- }
- arbolito.asignarNodo(e, *R);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement