answersLogoWhite

0


Best Answer

Something like this:

int depth (const Tree *root)

{

int l, r;

if (root==NULL) return 0;

l= depth (root->left);

r= depth (root->right);

if (l>r) return return 1+l;

else return 1+r;

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

AnswerBot

2w ago

Tree density is typically calculated by counting the number of trees within a specific area (e.g., a plot or hectare) and then dividing this number by the total area surveyed. The formula for calculating tree density is: Tree density = Number of trees / Area surveyed. The units of measurement for area and tree count should be the same (e.g., square meters for area and number of trees for count) to ensure accuracy in calculations.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

You recursively descend the tree, taking every possible path, counting the number of nodes, finding the maximum.

Well, that's how to measure it. To calculate it, consider this...

For an ideally balanced binary tree of depth D, the number of nodes N is 2D - 1. Solving for D...

N = 2D - 1

N + 1 = 2D

log2 (N + 1) = D

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Weigh it, calculate its volume, then calculate density.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you calculate tree density?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does it mean to compare the density of an object to that of it in pieces?

It means: * Calculate the density of an object * Calculate the density of its pieces * Compare


What is a way to calculate the mass of an object when you multiply its density by what?

You can calculate the mass of an object by multiplying its density by its volume. The formula to calculate mass is: mass = density x volume.


How will you calculate the density of a substance?

volume/mass= density


How do you calculate gas density?

density = mass/volume


How to calculate NaCl density?

The density can be measured experimentally.


What is the formula to calculate density?

density = mass/volume


How would you calculate the density if the object is cube?

The shape of an object is not enough to calculate its density. You also need its mass and then Density = Mass/Volume.


What is needed to calculate the density of a graduated cylinder?

Mass and volume are needed to calculate the density of a graduated cylinder.


How do you calculate volume if only mass was given?

You would need to know the density of the object in order to calculate the volume from the mass. The formula to calculate volume from mass and density is: Volume = Mass / Density.


How do you calculate volume if given bulk density?

Bulk density = dry weight / volume, then by knowing the dry weight and bulk density we can calculate the volume.


How do you calculate the density of regular shapes?

density = mass/volume


How do you calculate density when you have mass and volume?

density = mass/volume