Download root parent child leaf node edge - TAMU Computer Science Faculty

Transcript
CPSC 211 Data Structures & Implementations
(c) Texas A&M University [ 222]
Trees (cont’d)
Some more terms:
path: sequence of edges, each edge starts with the
node where the previous edge ends
length of path: number of edges in it
height of a node: length of longest path from the
node to a leaf
height of tree: height of root
depth (or level) of a node:
root to the node
length of path from
depth of tree: maximum depth of any leaf
Fact: The depth of a tree equals the height of the tree.
height
4
0, 3, 0
depth
0
1
2
2
0, 1
3
0
4