Friday, March 16, 2018

Depth of a node in binary tree

The depth of a node in a binary tree

Depth of a node

The depth of a node A in a binary tree is the length of the unique path (number of edges) from the root of the tree to the node A.
The root node is at the depth 0.

Example:

Depth of node K – 3 [edge AB (e1), edge BF (e4), and edge FK (e7)]
Depth of node I – 2 [edge AD (e2), and edge DI (e5)]
Depth of node J – 2 [edge AD (e2), and edge DJ (e6)]
Depth of node A – 0 [root node]

***********



Depth of a node in data structure
Depth of a node in binary tree
Find the depth of a binary tree node
Examples for finding the depth of a binary tree
How to calculate the depth of a binary tree





No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents