What is the difference between tree depth and height?

后端 未结 7 1623
[愿得一人]
[愿得一人] 2020-11-28 00:14

This is a simple question from algorithms theory.
The difference between them is that in one case you count number of nodes and in other number of edges on the shortest

7条回答
  •  不知归路
    2020-11-28 00:41

    Simple Answer:
    Depth:
    1. Tree: Number of edges/arc from the root node to the leaf node of the tree is called as the Depth of the Tree.
    2. Node: Number of edges/arc from the root node to that node is called as the Depth of that node.

提交回复
热议问题