I don't mean height or depth of node. My initial knowledge is that they are the same. Am I correct?
Asked
Active
Viewed 3,106 times
-2
-
1possible duplicate of [What is the difference between tree depth and height?](http://stackoverflow.com/questions/2603692/what-is-the-difference-between-tree-depth-and-height) – Daniel A.A. Pelsmaeker May 12 '15 at 20:29
1 Answers
2
Copied from this answer:
The depth of a node is the number of edges from the node to the tree's root node. A root node will have a depth of 0. The height of a node is the number of edges on the longest path from the node to a leaf. A leaf node will have a height of 0

Community
- 1
- 1

ashkufaraz
- 5,179
- 6
- 51
- 82
-
-
http://stackoverflow.com/questions/2603692/what-is-the-difference-between-tree-depth-and-height – ashkufaraz Mar 29 '15 at 07:05
-
These answers explain the height and depth of a single node in a tree. I want to know the height and depth of the entire tree. – computerguy Mar 29 '15 at 07:08
-
The **height** of a tree is equal to the **max depth** of a tree - the longest path from the root to a leaf – Drakes Mar 29 '15 at 07:36
-
Other way to put it, **Height** defines how many nodes are in a direct line between the deepest node in the tree and the current node, where **depth** defines how many parent nodes the current node has. – DerpyNerd May 12 '15 at 20:55