Question

1. a) Suppose that a binary tree of height h has n nodes. Show
that h ≥ log_{2} (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?

Answer #1

(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

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?

(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?

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 programing)

How
many levels will there be in a complete binary tree is it has n
number of nodes?
looking for formula

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...

In heapsort we view an array as a binary tree using the
following mapping: a[0] is the root of the entire tree and for
element a[i], its left child is a[2i+1] and its right child is
a[2i+2]. Answer the following questions for an array of size n. (
Answers in some cases may be in terms of n.)
a) What is the index of the parent a[i] for any i > 0?
b) What is the biggest index for which...

How can I prove that any node of a binary search tree of n nodes
can be made the root in at most n − 1 rotations?

Problem 3
Given a BST with N nodes, how many tree shapes are there with
height N-1? Explain your reasoning.
Problem 4
Given a BST with N nodes, how many tree shapes are there with
height N-2? Explain your reasoning .
Problem 5
Consider an empty 2-3 tree. Draw the tree after each of the
following operations is executed:
insert 0, insert 9, insert 2, insert 6, insert 7, insert 3,
insert 8, delete 2, delete 6

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 12 minutes ago

asked 12 minutes ago

asked 18 minutes ago

asked 22 minutes ago

asked 23 minutes ago

asked 25 minutes ago

asked 41 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago