Ceci est une ancienne révision du document !
Hauteur d'un arbre : profondeur maximale d'un arbre.
Algorithme permettant de calculer la hauteur d'un arbre :
VARIABLE T : arbre x : noeud DEBUT HAUTEUR(T) : si T ≠ NIL : x ← T.racine renvoyer 1 + max(HAUTEUR(x.gauche), HAUTEUR(x.droit)) sinon : renvoyer 0 fin si FIN
Taille d'un arbre : nombre de nœuds composant l'arbre
Algorithme permettant de calculer la taille de l'arbre :
VARIABLE T : arbre x : noeud DEBUT TAILLE(T) : si T ≠ NIL : x ← T.racine renvoyer 1 + TAILLE(x.gauche) + TAILLE(x.droit) sinon : renvoyer 0 fin si FIN