Ch 21

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The width of a tree is the largest number of nodes in the same level.

T

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. that it is more flexible than the unary tree structure e. None of these

A

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

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

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

Select all that apply. Binary trees may be implemented as templates, but any data types used with them must support the __________ operator. a. > b. < c. && d. == e. linked

A,B,D

Select all that apply. The head pointer, anchored at the top of a binary tree, may be called the a. root node b. tree pointer c. binary pointer d. leaf pointer e. node pointer

B

The process of stepping through the nodes of a binary tree is known as a. climbing b. traversing c. stepping through d. branching out e. None of these

B

Values are typically stored in a binary search tree so that a node's __________ child holds data that 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

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

When you dereference a pointer to a pointer, the result is a. a value of the data type that is pointed to b. another pointer c. not possible to determine d. a null pointer e. None of these

B

Select all that apply. Which of the following operations can be performed on a binary search tree? a. moving b. inserting c. finding d. placing e. deleting

B,C,E

Select all that apply. Which of the following are methods of traversing a binary tree? a. LeftOrder traversal b. PreOrder traversal c. FrontOrder traversal d. InOrder traversal e. PostOrder traversal

B,D,E

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

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

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

Binary trees can be divided into a. branches b. leaves c. subtrees d. sawdust e. None of these

C

In a binary tree class you usually have a pointer as a member that is set to the a. leftmost child node b. first leaf node c. root of the tree d. deepest leaf node e. None of these

C

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

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

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 leftmost child node d. a null pointer e. None of these

D

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

In a binary tree, each node may point to __________ other node(s). a. no b. one c. two d. Any of these e. None of these

D

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

When a binary tree is used to facilitate a search, it is referred to as a a. binary queue b. binary ordered deque c. sort algorithm d. binary search tree e. None of these

D

When an application begins by 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 rightmost child of the root node d. the root node e. None of these

D

The height of a tree describes how many levels there are in the tree.

T

In a binary tree, each node must have a minimum of two children.

F

Output will be the same if you use InOrder, PostOrder, or PreOrder traversals of the same binary tree.

F

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

F

The intBinaryTree class has a public member function, findNode, that returns true if a value is not found and false if the value is found.

F

To remove a node that has children, you must first remove the children.

F

A subtree is an entire branch of a tree from one particular node down.

T

All nodes to the right of a node hold values greater than that node's value.

T

Binary trees are commonly used to organize key values that index database records.

T

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

T

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.

T

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

T

The binary tree structure is called a "tree" because it resembles an upside-down tree.

T


Ensembles d'études connexes

Dynamics of Negotiations (Bellman) Final

View Set

Energy in the 21st century Exam 2

View Set

Zoom 2, Hi! How are you?, page 5

View Set