Advertisement
Guest User

Untitled

a guest
May 25th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. template<class ARB>
  2. int ArbolBinario<ARB>::profundidadArbol(){
  3.     if (arbolVacio()) {
  4.         return 0;      
  5.     } else {
  6.         if(puntPadre->izq->arbolVacio() && puntPadre->der->arbolVacio() {
  7.             return 1;
  8.     } else {
  9.         return (1 + max (puntPadre->izq->profundidadArbol(), puntPadre->der->profundidadArbol())
  10.     }
  11.        
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement