For any node n, the depth of n is the length of the unique path from the root to node n. Thus for a root the depth is always zero.
Define Depth of tree?
September 14, 2023 in Data Structure
September 14, 2023 in Data Structure
For any node n, the depth of n is the length of the unique path from the root to node n. Thus for a root the depth is always zero.