topicuncategorized

Height and Depth of a Node in Tree

Height

The height of a node is the number of edges from the node to the deepest leaf (ie. the longest path from the node to a leaf node).

Depth

The depth of a node is the number of edges from the root to the node.

More

[Height of a Tree Definition](height-of-a-tree-definition)

graph TD;
	A("h = 2<br/>d = 0") --- B("h = 1<br/>d = 1") & C("h = 0<br/>d = 1")
	B --- D("h = 0<br/>d = 2") & E("h = 0<br/>d = 2")