Chapter 21 quiz for may 3

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

12) True/False: The width of a tree is the largest number of nodes in the same level. Answer: TRUE

TRUE

13) True/False: All nodes to the right of a node hold values greater than the node's value. Answer: TRUE

TRUE

2) True/False: The inorder method of traversing a binary tree involves traversing the node's left subtree, processing the node's data, and then traversing the node's right subtree. Answer: TRUE

TRUE

5) True/False: The height of a tree describes how many levels there are in the tree. Answer: TRUE

TRUE

6) True/False: Binary trees are commonly used to organize key values that index database records. Answer: TRUE

TRUE

7) True/False: Deleting a leaf node from a binary tree is not difficult. Deleting a non-leaf node requires several steps. Answer: TRUE

TRUE

) True/False: A subtree is an entire branch of a tree, from one particular node down. Answer: TRUE

TRUE

1) True/False: The binary tree structure is called a "tree" because it resembles an upside-down tree. Answer: TRUE

TRUE

5) When a binary tree is used to facilitate a search, it is referred to as a ________. A) binary queue B) binary ordered deque C) binary search tree D) sort algorithm E) None of these Answer: C

5) When a binary tree is used to facilitate a search, it is referred to as a ________. A) binary queue B) binary ordered deque C) binary search tree D) sort algorithm E) None of these Answer: C

16) When the root node points to two other nodes, the nodes are referred to as ________. A) child nodes, or children B) parent nodes, or parents C) binary nodes D) subnodes E) None of these Answer: A

A) child nodes, or children

24) The inorder, preorder, and postorder traversals can be accomplished using ________. A) recursion B) no pointers C) no arguments D) no parameters E) None of these Answer: A

A) recursion

7) The ________ in a binary tree is similar to the head pointer in a linked list. A) root pointer B) leaf pointer C) null pointer D) binary pointer E) None of these Answer: A

A) root pointer

2) A good reason to use the binary tree structure is: A) to expedite the process of searching large sets of information B) aesthetics and program design C) code readability D) it is more flexible than the Unary Tree structure E) None of these Answer: A

A) to expedite the process of searching large sets of information

18) Binary trees can be divided into: A) branches B) leaves C) subtrees D) sawdust E) None of these Answer: C

C) subtrees

13) When you dereference a pointer to a pointer, the result is: A) a value of the data type pointed to B) another pointer C) not possible to determine D) a null pointer E) None of these Answer: B

B) another pointer

10) When working with a binary tree, a node that has more than two children: A) will be cut back by the compiler B) is theoretically impossible in a correctly-developed binary tree structure C) is known as a triplet node D) None of these Answer: B

B) is theoretically impossible in a correctly-developed binary tree structure

11) Values are typically stored in a binary search tree so that a node's ________ child holds data is less than the ________ data. A) right, node's B) left, node's C) right, left child's D) left, right child's E) None of these Answer: B

B) left, node's

8) The process of stepping through the nodes of a binary tree is known as ________. A) climbing B) traversing C) walking through D) branching out E) None of these Answer: B

B) traversing

15) The head pointer, anchored at the top of a binary tree, is called the ________. A) root node B) tree pointer C) binary pointer D) Either A or C E) None of these Answer: B

B) tree pointer

10) True/False: Dereferencing a pointer to a pointer gives you another pointer. Answer: TRUE

TRUE

6) When an application begins searching a binary tree, it starts at ________. A) the outermost leaf node B) the middle node, halfway between the root and the longest branch C) the root node D) the rightmost child of the root node E) None of these Answer: C

C root node

4) A node that has no children is known as a ________. A) root node B) head node C) leaf node D) pure binary node E) None of these Answer: C

C) leaf node

14) In a non-linear linked list, a node can point to: A) only the next node in sequence B) only the previous node in sequence C) more than one other node, plus the previous node in sequence D) all of the other nodes in the list E) None of these Answer: C

C) more than one other node, plus the previous node in sequence

3) The first node in a binary tree list is called the ________. A) head pointer B) binary node C) root node D) pointer node E) None of these Answer: C

C) root node

21) In a binary tree class, you usually have a pointer as a member that is set to ________. A) the leftmost child node B) the first leaf node C) the root of the tree D) the deepest leaf node E) None of these Answer: C

C) the root of the tree

25) A binary tree with a height of three has: A) six nodes B) one root and three nodes with two children each C) three levels D) three subtrees E) None of these Answer: C

C) three levels

20) A binary tree can be created using a struct or class containing a data value and ________. A) a pointer to the first child node B) a pointer to the last child node C) two pointers, one for the left child and one for the right child D) two data nodes E) None of these Answer: C

C) two pointers, one for the left child and one for the right child

23) Methods of traversing a binary tree are: A) inorder traversal B) preorder traversal C) postorder traversal D) All of these E) None of these Answer: D

D all of these

12) Deleting a node that has two children offers an opportunity to use: A) a function that returns a pointer to a pointer B) a function parameter that is a pointer to a pointer C) double indirection D) All of these E) None of these Answer: D

D) All of these

19) An operation that can be performed on a binary search tree is: A) insertion B) finding C) deleting D) All of these E) None of these Answer: D

D) All of these

9) Binary trees may be implemented as templates, but any data types used with them must support the ________ operator. A) < B) > C) == D) All of these E) None of these Answer: D

D) All of these

17) All node pointers that do not point to other nodes are set to: A) the root of the tree B) a parent node C) their left-most child node D) a null pointer E) None of these Answer: D

D) a null pointer

1) In a binary tree, each node may point to ________ other nodes. A) no B) one C) two D) All of these E) None of these Answer: D

D) all of these

22) The shape of a binary tree is ________. A) always triangular B) always balanced C) determined by the programmer D) determined by the order in which values are inserted E) None of these Answer: D

D) determined by the order in which values are inserted

11) True/False: To remove a node that has children, you must first remove the children. Answer: FALSE

FALSE

8) True/False: In a binary tree, each node must have a minimum of two children. Answer: FALSE

FALSE

True/False: Output will be the same if you use inorder, postorder, or preorder traversals of the same binary tree. Answer: FALSE

FALSE

9) True/False: The preorder method of traversing a binary tree involves processing the node's data, traversing the node's left subtree, then traversing the node's right subtree. Answer: TRUE

True


Kaugnay na mga set ng pag-aaral

FUNDAMENTALS OF NURSING EXAM QUESTIONS

View Set

Systemic final - old material questions

View Set

biology 106 final exam questions

View Set

History - British Empire; Chapter 3 - Trade and Commerce

View Set