Question

(Algorithm) A binary tree has a height of h=4. What is the number of nodes of...

(Algorithm)

A binary tree has a height of h=4. What is the number of nodes of this binary tree if the tree is:

a) A full binary tree

b) A complete binary tree

Homework Answers

Answer #1

Here, we have height h of a given tree is 4.

i.e. h = 4

Full binary tree :-

A tree is said to be full binary tree if every node has 0 or 2 childrens except leaf nodes.

So, for h=4 we have possibly,

9, 11, 13 and 15 nodes i.e.

Here, we see that all the trees are full binary trees as all all them have 0 or 2 childrens except leaf node.

So, for h = 4 the possible numbers of nodes for full binary tree are 9, 11, 13 and 15.

Complete binary tree :-

In complete binary tree we have all the levels are completely filled except possibly the last level and last level have keys as left as possible.

So, for h = 4 we have possibly,

8, 9, 10, 11 and 15 nodes i.e.

Here, we see that all the all the levels except the last level is completely filled and all the leaves in the last level are all to the left side.

So, for h=4 the number of nodes for complete binary tree are 8, 9, 10, 11 and 15.

Thumbs up!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
(Algorithm) A full binary tree has start node, internal nodes, and leaf nodes. The number of...
(Algorithm) A full binary tree has start node, internal nodes, and leaf nodes. The number of leaf nodes of this binary tree is 256. a) What is the height of the tree? b) How many internal nodes are in the tree?
1. a) Suppose that a binary tree of height h has n nodes. Show that h...
1. a) Suppose that a binary tree of height h has n nodes. Show that h ≥ log2 (n+2) - 1. b) Using the formula in part (a) find the minimum height if a binary tree with 1000 nodes. c) What is the maximum possible height of a binary tree with 1000 nodes?
Maximum how many nodes can there be in a complete Binary Tree with level h?
Maximum how many nodes can there be in a complete Binary Tree with level h?
Maximum how many nodes can there be in a complete Binary Tree with level h? (java...
Maximum how many nodes can there be in a complete Binary Tree with level h? (java programing)
Suppose T is a binary search tree of height 4 (including the external nodes) that is...
Suppose T is a binary search tree of height 4 (including the external nodes) that is storing all the integers in the range from 1 to 15, inclusive. Suppose further that you do a search for the number 11. Explain why it is impossible for the sequence of numbers you encounter in this search to be (9, 12, 10, 11).
An empty tree has height ________ A tree with just a root and no other nodes...
An empty tree has height ________ A tree with just a root and no other nodes has height___ The root is at depth_____ What is the maximum possible height for a tree with 31 nodes? What is the minimum possible height for a tree with 31 nodes?
Prove that a full non-empty binary tree must have an odd number of nodes via induction
Prove that a full non-empty binary tree must have an odd number of nodes via induction
How many levels will there be in a complete binary tree is it has n number...
How many levels will there be in a complete binary tree is it has n number of nodes? looking for formula
Define the height of a tree as the maximum number of edges between the root and...
Define the height of a tree as the maximum number of edges between the root and any leaf. We consider the height of an empty tree to be -1, and the height of a tree consisting of a single node to be 0. Prove by induction that every non-empty binary tree of height h contains fewer than 2h+1 nodes.
A binary tree isfullif every non-leaf node has exactly two children. For context, recallthat we saw...
A binary tree isfullif every non-leaf node has exactly two children. For context, recallthat we saw in lecture that a binary tree of heighthcan have at most 2h+1−1 nodes, and thatit achieves this maximum if it iscomplete, meaning that it is full and all leaves are at the samedistance from the root. Findμ(h), theminimumnumber of nodes that a full tree of heighthcan have, and prove your answer using ordinary induction onh. Note that tree of height of 0 isa single...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT