# Quiz 19: Binary Trees

Computing

Q 1Q 1

Every node in a binary tree can have pointers to
A)its end nodes.
B)binary nodes.
C)its left and right parent.
D)its left and right child.
E)None of the above

Free

Multiple Choice

D

Q 2Q 2

Implementing a binary tree in a class requires a structure for representing the nodes of the binary tree, as well as a pointer to the structure as a class member. This pointer will be set to
A)the deepest leaf node.
B)the leftmost child node.
C)the first leaf node.
D)the root of the tree.
E)None of the above

Free

Multiple Choice

D

Q 3Q 3

One method of traversing a binary tree is
A)postorder traversal.
B)preorder traversal.
C)inorder traversal.
D)All of the above
E)None of the above

Free

Multiple Choice

D

Q 4Q 4

An operation that can be performed on a binary search tree is
A)removing a value stored in the tree.
B)insertion of new value.
C)searching the tree for the occurrence of a given value.
D)All of the above
E)None of the above

Free

Multiple Choice

Q 5Q 5

When a binary tree is used to facilitate a search, it is referred to as a
A)binary search tree.
B)sort algorithm.
C)binary queue.
D)binary ordered deque.
E)None of the above

Free

Multiple Choice

Q 6Q 6

Inorder, preorder, and postorder traversals can be accomplished using
A)no parameters.
B)recursion.
C)no arguments.
D)no pointers.
E)None of the above.

Free

Multiple Choice

Q 7Q 7

A child node that has no parent is
A)a leaf node.
B)a rootless node.
C)an orphan node.
D)A or C
E)None of the above

Free

Multiple Choice

Q 8Q 8

Deleting a node from a binary search tree node
A)is hardest when the node has two children.
B)is hardest when the node is a leaf.
C)is easiest when the node is the root.
D)is hardest when the node has one child.
E)None of the above

Free

Multiple Choice

Q 9Q 9

The in a binary tree is analogous to the head pointer in a linked list.
A)leaf pointer
B)null pointer
C)binary pointer
D)root pointer
E)None of the above

Free

Multiple Choice

Q 10Q 10

A binary tree node with no parent is called the
A)pointer node.
B)binary node.
C)root node.
D)head pointer.
E)None of the above

Free

Multiple Choice

Q 11Q 11

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

Free

Multiple Choice

Q 12Q 12

A binary tree can be created using a structure containing a data value and
A)two pointers, one for the left child and one for the right child.
B)two data nodes.
C)a pointer to the first child node.
D)a pointer to the last child node.
E)None of the above

Free

Multiple Choice

Q 13Q 13

The main difference between a binary tree and a linked list is that
A)nodes in a binary tree have two successors instead of one.
B)recursion is useful on binary trees, but not on linked lists.
C)a linked list can be empty, but a binary tree cannot.
D)a binary tree can be empty, but a linked list cannot.
E)None of the above

Free

Multiple Choice

Q 14Q 14

Visiting all nodes of a binary tree in some methodical fashion is known as
A)climbing the tree.
B)walking through tree.
C)traversing the tree.
D)branching out along the tree.
E)None of the above

Free

Multiple Choice

Q 15Q 15

A program keeps track of a binary tree using a pointer to
A)its root node.
B)the node in the tree holding the smallest value.
C)one of its leaves.
D)the node in the tree holding the biggest value.
E)None of the above

Free

Multiple Choice

Q 16Q 16

A strong reason to use a binary search tree is
A)it is more flexible than the unary search tree.
B)to enhance code readability.
C)aesthetics and program design.
D)to expedite the process of searching large sets of information.
E)None of the above

Free

Multiple Choice

Q 17Q 17

If a node has no successor, the corresponding pointer is set to
A)NULL .
B)the root of the tree.
C)a leaf.
D)point to its parent node.
E)None of the above

Free

Multiple Choice

Q 18Q 18

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

Free

Multiple Choice

Q 19Q 19

A node that has no children is a
A)head node.
B)root node.
C)pure binary node.
D)leaf node.
E)None of the above

Free

Multiple Choice

Q 20Q 20

Values are commonly stored in a binary search tree so that a node's _ child holds data that is less than the _ _ data, while the node's data is less than the data in the other child.
A)right, node's
B)right, left child's
C)left, node's
D)left, right child's
E)None of the above

Free

Multiple Choice

Q 21Q 21

Binary search trees are commonly used
A)in linear data communication processes.
B)with arrays of integers.
C)in database applications.
D)A and C
E)None of the above

Free

Multiple Choice

Q 22Q 22

A tree with a height of three must have
A)one root and three nodes with two children each.
B)six nodes.
C)three levels.
D)three subtrees.
E)None of the above

Free

Multiple Choice

Free

True False

Q 24Q 24

The number of nodes in a binary tree is the number of nodes in its left subtree plus the number of nodes in its right subtree.

Free

True False

Q 25Q 25

The inorder method of traversing a binary tree involves traversing the left subtree, processing the data in the root, and then traversing the right subtree.

Free

True False

Q 26Q 26

The preorder method of traversing a binary tree involves processing the root node's data, traversing the left subtree, and then traversing the right subtree.

Free

True False

Q 27Q 27

In a binary search tree, all nodes to the right of a node hold values greater than the node's value.

Free

True False

Free

True False

Q 29Q 29

Output will be the same if you use inorder, postorder, or preorder traversals to print the values stored in a binary tree.

Free

True False

Free

True False

Free

True False

Q 32Q 32

In certain types of binary trees, the number of leaves can be greater than the number of nodes.

Free

True False

Free

True False

Free

True False

Q 35Q 35

In a binary search tree where all the stored values are different, the node holding the largest value cannot have two children.

Free

True False

Q 36Q 36

Deleting a leaf node from a binary search tree is not difficult. Deleting a non- leaf node requires several steps.

Free

True False

Free

True False