Compute the maximum depth of a tree — the number of nodes along the longest path from the root down to a leaf. The tree may be binary or n-ary (e.g. a nested issue / sub-issue structure).
A
/ \
B C
|
D
max depth = 3 (A -> C -> D)