1/37
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
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
D) all of these
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
A) to expedite the process of searching large sets of information
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
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
C) leaf node
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
C) binary search tree
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
C) root node
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
A) root pointer
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
B) traversing
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
D) All of these
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
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
B) left, node's
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
D) All of these
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
B) another pointer
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
C) more than one other node, plus the previous node in sequence
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
B) tree pointer
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
A) child nodes, or children
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
D) a null pointer
18) Binary trees can be divided into:
A) branches
B) leaves
C) subtrees
D) sawdust
E) None of these
C) subtrees
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
D) All of these
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
C) two pointers, one for the left child and one for the right child
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
C) the root of the tree
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
D) determined by the order in which values are inserted
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
D all of these
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
A) recursion
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
C) three levels
1) True/False: The binary tree structure is called a "tree" because it resembles an upside-down tree.
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.
TRUE
True/False: A subtree is an entire branch of a tree, from one particular node down.
TRUE
True/False: Output will be the same if you use inorder, postorder, or preorder traversals of the same binary tree.
FALSE
5) True/False: The height of a tree describes how many levels there are in the tree.
TRUE
6) True/False: Binary trees are commonly used to organize key values that index database records.
TRUE
7) True/False: Deleting a leaf node from a binary tree is not difficult. Deleting a non-leaf node requires several steps.
TRUE
8) True/False: In a binary tree, each node must have a minimum of two children.
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.
True
10) True/False: Dereferencing a pointer to a pointer gives you another pointer.
TRUE
11) True/False: To remove a node that has children, you must first remove the children.
FALSE
12) True/False: The width of a tree is the largest number of nodes in the same level.
TRUE
13) True/False: All nodes to the right of a node hold values greater than the node's value.
TRUE