Graph Theory37 sections · 1633 units
Open in Course

What is Tree Diameter

Longest possible path

The diameter of a tree is the length of the longest path between any two nodes. Not the longest path from the root (that is height), but the longest path anywhere in the tree.

Example: If your tree has nodes A-B-C-D-E in a line, the diameter is 44 (the path from A to E). If you add a branch, the diameter might change.

A long skinny tree has high diameter. A bushy tree might have lower diameter despite having more nodes.