Which of the following statements are correct for the expression trees? (Select all that applies.) a. An expression tree is a binary tree. b. The root and internal nodes are operators. c. Each leaf is an operand. d. Subtrees are sub-expressions, with the root being an operator.   2. The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is: a. (2^h)-1 b. (2^(h+1))-1 c. 2*(h+1)-1 3. Which of the following statements are correct? (Select all that applies.) a. The maximum number of internal and external nodes in a proper binary tree with n nodes are (n-1)/2 and (n+1)/2, respectively. b. The maximum number of nodes at level k (k = 0,1,2,...) of a proper binary tree: 2^k c. Depth of a node refers to the number of ancestors. d. Height of a tree refers to the the maximum of the depths of its leaf positions.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Which of the following statements are correct for the expression trees? (Select all that applies.)

a. An expression tree is a binary tree.
b. The root and internal nodes are operators.
c. Each leaf is an operand.
d. Subtrees are sub-expressions, with the root being an operator.
 

2. The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:

a. (2^h)-1
b. (2^(h+1))-1
c. 2*(h+1)-1

3. Which of the following statements are correct? (Select all that applies.)

a. The maximum number of internal and external nodes in a proper binary tree with n nodes are (n-1)/2 and (n+1)/2, respectively.

b. The maximum number of nodes at level k (k = 0,1,2,...) of a proper binary tree: 2^k

c. Depth of a node refers to the number of ancestors.
d. Height of a tree refers to the the maximum of the depths of its leaf positions.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning