answersLogoWhite

0

height and depth of a tree is equal...

but height and depth of a node is not equal because...

the height is calculated by traversing from leaf to the given node

depth is calculated from traversal from root to the given node.....

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Difference between height of a tree and depth of a tree and level of a tree?

The height of a tree is the longest path from the root to a leaf, counting the number of edges. The depth of a tree is the longest path from the root to a leaf, counting the number of nodes. The level of a tree refers to the depth of a node with respect to the root, where the root is considered to be at level 0.


What is the difference in height between a tree and a shrub?

kilometers


How do you calculate the height of a binary tree?

To calculate the height of a binary tree, you can use a recursive algorithm that traverses the tree and keeps track of the height at each level. The height of a binary tree is the maximum depth of the tree, which is the longest path from the root to a leaf node.


Is there a difference in height between a grey and red squirrel l?

it depends on how high up the tree they are at the time?


What is the measuring difference between height and length?

Both height and length are linear measurements. The units of measure are the same. Height -- not heighth -- is synonymous with altitude, and can be thought of as the distance above the ground, as in the height of a skyscraper or the height of a tall tree (or any tree, for that matter).


What is difference between tree and hybrid topology?

no difference,,,tree and hybrid are same.


What is the difference between strictly binary tree and complete binary tree?

Complete Binary tree: -All leaf nodes are found at the tree depth level -All nodes(non-leaf) have two children Strictly Binary tree: -Nodes can have 0 or 2 children


What is the difference between extended binary tree and complete binary tree?

Complete Binary tree: All leaf nodes are found at the tree depth level and All non-leaf nodes have two children. Extended Binary tree: Nodes can have either 0 or 2 children.


Depth and Height of Binary tree?

height(node):if node == null:return 0else:max(height(node.L), height(node.R)) + 1/*Function to print level order traversal of tree*/getMaxWidth(tree)maxWdth = 0for i = 1 to height(tree)width = getWidth(tree, i);if(width > maxWdth)maxWdth = widthreturn width/*Function to get width of a given level */getWidth(tree, level)if tree is NULL then return 0;if level is 1, then return 1;else if level greater than 1, thenreturn getWidth(tree->left, level-1) +getWidth(tree->right, level-1);


How can the height of a tree be calculated?

It can easily be measured by using a protractor and measuring the angle between the ground and the top of the tree. You need to know exactly how far you are from the tree. Then you can use trigonometry to calculate the height of the tree. Tan (angle in degrees) = height of tree / distance from tree


What is the difference between tree and forest?

A tree is one tree and a forest is many trees.


Difference between syntax tree and parse tree?

i dont know but i