edited by
11,263 views

1 Answer

Best answer
4 votes
4 votes

Actually, the terms would be defined in question itself.
But generally, we define them as follows:
The height of any node is the distance of the node form the root.
The depth of the node is the distance of the node from the leaf to that node.
Level starts from the root node. (In question, they define whether level starts from 0 or 1).

 

selected by

Related questions

1 votes
1 votes
0 answers
1
Rohit Gupta 8 asked Dec 25, 2017
1,149 views
If the average depth of a node in an $n$-node binary search tree is $O(\log{n})$, then the height of the tree is$O(n\log{n})$$O(n)$$O(\log{n})$$O(\sqrt(n\log{n}))$
0 votes
0 votes
1 answer
2
sripo asked Nov 8, 2018
681 views
For a heap containing n elements,smallest element can be found in n/2 operations.I always get confused and think as logn operations.Please help me differentiating between...
0 votes
0 votes
2 answers
3
Aman Bisht asked Jun 12, 2017
1,124 views
The height of a binary tree having 'i' nodes at level 'i' considering root to be at level 1 is . where 'n' is the total no of nodes in the tree.A. O(logn)B. O(n)C. O(R...