395 views
0 votes
0 votes
I have seen that in some question height and deapth of binary tree are used interchangably. So, I request to say difference between height and deapth of a binary tree.

1 Answer

0 votes
0 votes

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.

Related questions

3 votes
3 votes
5 answers
4
srestha asked May 22, 2019
1,794 views
Consider the following function height, to which pointer to the root node of a binary tree shown below is passedNote that max(a,b) defined by #define max(a,b) (a>b)?a:b.i...