Access Millions of academic & study documents

5 (10 points) In a 5 ary tree, that is a tree with at most 5 childr

Content type
User Generated
Showing Page:
1/2
5. (10 points) In a 5-ary tree, that is a tree with at most 5
children at each node, how many nodes
can a tree of height H have. Recall that the height of a
tree is a length of the longest path from
the root to the leaf nodes of the tree.
6. (10 points) In a 5-ary tree, what is the maximum height
of a tree with N nodes. Since that was
easy, let\'s try one a little harder: what is the minimum
height of a tree with N nodes?
Solution
Answer:)
5.When H = 0, #nodes = 1
When H = 1, #nodes = 5+1
When H=2, #nodes = 25 + 5 + 1
Therefore,when H = n, #nodes = 5^n + 5^(n-1) + 5^(n-2)
+...+5^1+5^0
6.
Maximum height of a tree with N nodes = N - 1
Minimum height of a tree with N nodes = floor(log5N)

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
5. (10 points) In a 5-ary tree, that is a tree with at most 5 children at each node, how many nodes can a tree of height H have. Recall that the height of a tree is a length of the longest path from the root to the leaf nodes of the tree. 6. (10 points) In a 5-ary tree, what is the maximum height of a tree with N nodes. Since that was easy, let\'s try one a little harder: what is the minimum height of a tree with N nodes? Solution Answer:) 5.When H = 0, #nodes = 1 When H = 1, #nodes = 5+1 When H=2, #nodes = 25 + 5 + 1 Therefore,when H = n, #nodes = 5^n + 5^(n -1) + 5^(n-2) +...+5^1+5^0 6. Ma ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4