Question
A. Tree is a data structure defined as a root node linked with zero or more sub-trees (same recursive definition as tree). Given a binary
A. Tree is a data structure defined as a root node linked with zero or more sub-trees (same recursive definition as tree). Given a binary tree in which the root can have at most two subtrees, we define a new type of binary tree that further satisfies the balance condition next: for any node in such a tree, the heights of left and right subtrees can differ by 1 (left and right heights are the same or one-level different). Describe the way to compute the maximum number of nodes and minimum number of nodes respectively in such a tree with given height 20.
B. Write a short program to compute the minimum number of nodes in such a tree with height of 100. List the program and printed results on paper. This is also an exercise for you to test your programming environment and basic programming skill.
USING C++ ONLY
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started