Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 10 Trees Data Structures and Other Objects Using C++ by Michael Main and Walter Savitch 11. Suppose T is a binary tree with 14

Chapter 10 Trees

Data Structures and Other Objects Using C++ by Michael Main and Walter Savitch

11. Suppose T is a binary tree with 14 nodes. What is the minimum possible depth of T?

? A. 0

? B. 3

? C. 4

? D. 5

12. Select the one FALSE statement about binary trees:

? A. Every binary tree has at least one node.

? B. Every non-empty tree has exactly one root node.

? C. Every node has at most two children.

? D. Every non-root node has exactly one parent.

13. Consider the binary_tree_node from Section 10.3. Which expression indicates that t represents an empty tree?

? A. (t == NULL)

? B. (t->data( ) == 0)

? C. (t->data( ) == NULL)

? D. ((t->left( ) == NULL) && (t->right( ) == NULL))

14. Consider the node of a complete binary tree whose value is stored in data[i] for an array implementation. If this node has a right child, where will the right child's value be stored?

? A. data[i+1]

? B. data[i+2]

? C. data[2*i + 1]

? D. data[2*i + 2]

15. How many recursive calls usually occur in the implementation of the tree_clear function for a binary tree?

? A. 0

? B. 1

? C. 2

16. Suppose that a binary taxonomy tree includes 8 animals. What is the minimum number of NONLEAF nodes in the tree?

? A. 1

? B. 3

? C. 5

? D. 7

? E. 8

14

/ \

2 11

/ \ / \

1 3 10 30

/ /

7 40

17. There is a tree in the box at the top of this section. What is the order of nodes visited using a pre-order traversal?

? A. 1 2 3 7 10 11 14 30 40

? B. 1 2 3 14 7 10 11 40 30

? C. 1 3 2 7 10 40 30 11 14

? D. 14 2 1 3 11 10 7 30 40

18. There is a tree in the box at the top of this section. What is the order of nodes visited using an in-order traversal?

? A. 1 2 3 7 10 11 14 30 40

? B. 1 2 3 14 7 10 11 40 30

? C. 1 3 2 7 10 40 30 11 14

? D. 14 2 1 3 11 10 7 30 40

19. There is a tree in the box at the top of this section. What is the order of nodes visited using a post-order traversal?

? A. 1 2 3 7 10 11 14 30 40

? B. 1 2 3 14 7 10 11 40 30

? C. 1 3 2 7 10 40 30 11 14

? D. 14 2 1 3 11 10 7 30 40

20. Consider this binary search tree:

14

/ \

2 16

/ \

1 5

/

4

Suppose we remove the root, replacing it with something from the left subtree. What will be the new root?

? A. 1

? B. 2

? C. 4

? D. 5

? E. 16

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

Solve the following 1,4 3 2TT 5x- 1+ (15 x) dx 5X

Answered: 1 week ago