Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Depth, height, size » ?

Aussi appelé : depth · height · size

Definition 25.2 High School Computer Science · Chapitre 25 — Trees and Binary Search Trees

The depth of a node is the number of links from the root to it: the root has depth 00. The height of a tree is the largest depth of its nodes; a tree of one node has height 00, and by convention the empty tree has height −1-1. The size of a tree is its number of nodes.

A tree of size 7 and height 3. A is the root; D, G and F are the leaves (shaded); B is the parent of D and E. The dashed line surrounds the subtree of root B: size 4, height 2.
A tree of size 77 and height 33. A is the root; D, G and F are the leaves (shaded); B is the parent of D and E. The dashed line surrounds the subtree of root B: size 44, height 22.
Lire dans le chapitre →