Height of a tree with only one node

后端 未结 6 1377
天涯浪人
天涯浪人 2020-12-14 01:29

According to Wikipedia,

The height of a tree is the length of the path from the root to the deepest node in the tree. A (rooted) tree with only one

6条回答
  •  感动是毒
    2020-12-14 02:34

    One advantage of using a node count rather than an edge count is that it distinguishes the empty case (zero nodes, and node level) from the minimal case (one node, and a node level of one). In some cases, an empty tree will not be meaningful, but in other cases an empty try will be perfectly legitimate.

提交回复
热议问题