Data Structures Test

profilejpFlute
data_structures_test.docx

Question 1

The syntax for accessing a class (struct) member using the operator -> is ____.

A.

pointerVariableName.classMemberName

B.

pointerVariableName->classMemberName

C.

pointerVariableName&->classMemberName

Question 2

Operations, such as finding the height, determining the number of nodes, checking whether the tree is empty, tree traversal, and so on, on AVL trees cannot be implemented the same way they are implemented on binary trees.

True

False

Question 3

The expression vecCont.empty() empties the vector container of all elements.

True

False

Question 4

Because a queue is an important data structure, the Standard Template Library (STL) provides a class to implement queues in a program.

True

False

Question 5

Every call to a recursive function requires the system to allocate memory for the local variables and formal parameters

True

False

Question 6

A linked list is a collection of ____.

A.

classes

B.

addresses

C.

nodes

Question 7

The deque class is a type of container adapter.

True

False

Question 8

The binary search algorithm uses the ____ technique to search the list.

A.

conquer-and-resign

B.

divide-and-conquer

C.

divide-and-divide

Question 9

Containers are essentially used ____.

A.

to manage objects of a given type

B.

to manipulate data

C.

to update objects that are part of a given set of elements

Question 10

The header node is placed at the ____ of a list.

A.

end

B.

beginning

C.

middle

Question 11

The use of a queue structure ensures that the items are processed in the order they are received.

True

False

Question 12

The analysis of algorithms enables programmers to decide which algorithm to use for a specific application.

True

False

Question 13

To define new classes, you create new ____ files.

A.

placeholder

B.

friend

C.

header

Question 14

Containers are class templates.

True

False

Question 15

Default arguments can be used with an overloaded operator.

True

False

Question 16

In breadth first traversal, starting at the first vertex, the graph is traversed as little as possible.

True

False

Question 17

The number of key comparisons in a sequential search depends on the value of the search item.

True

False

Question 18

____ iterators are forward iterators that can also iterate backward over the elements.

A.

Output

B.

Input

C.

Bidirectional

Question 19

We can traverse a singly linked list backward starting from the last node.

True

False

Question 20

In the random probing method, the ith slot in the probe sequence is ____.

A.

(h(X) % HTSize) + ri

B.

(h(X) + ri) % HTSize

C.

(h(X) + HTSize) % ri

D.

(h(X) % ri) + HTSize

Question 21

With the help of the ____, two values can be combined into a single unit and, therefore, can be treated as one unit.

A.

class unit

B.

class pair

C.

class double

D.

class tuple

Question 22

The operation ____ reinitializes the stack to an empty state.

A.

alloc

B.

initializeStack

C.

init

Question 23

The copy constructor automatically executes when, as a parameter, an object is passed by value.

True

False

Question 24

The expression vecList.front() moves an element to the front of the vector.

True

False

Question 25

When the destructor ____ the queue, it deallocates the memory occupied by the elements of the queue.

A.

instantiates

B.

allocates

C.

destroys

Question 26

To remove, or pop, an element from the stack ____.

A.

invert stackTop

B.

increment stackTop by 1

C.

decrement stackTop by 1

Question 27

The components of a class are called the ____ of the class.

A.

members

B.

operators

C.

objects

Question 28

In a doubly linked list, some of the operations require modification from how they were implemented for a regular linked list, because of the ____ pointer(s) in each node.

A.

two

B.

null

C.

three

Question 29

If the list is stored in an array, we can traverse the list in either direction using an ____.

A.

index variable

B.

increment variable

C.

interface variable

Question 30

If the list is stored in a linked list, we can traverse the list in only one direction starting at the first node because the links are only in one direction.

True

False

Question 31

The structured design approach is also known as ____.

A.

object design

B.

top-down design

C.

bottom-up design

Question 32

The derived class can redefine public member functions of a base class.

True

False

Question 33

A list is ordered if its elements are ordered according to some criteria.

True

False

Question 34

A technique in which one system models the behavior of another system is called ____.

A.

bench testing

B.

referencing

C.

simulation

Question 35

In a ____, customers or jobs with higher priority are pushed to the front of the queue.

A.

false queue

B.

free queue

C.

double queue

D.

priority queue

Question 36

A ____ is a list in which each element contains a key, such that the key in the element at position k in the list is at least as large as the key in the element at position 2k + 1 (if it exists) and 2k + 2 (if it exists).

A.

heap

B.

hemp

C.

hash table

Question 37

A precondition is a statement specifying the condition(s) that must be true before the function is called.

True

False

Question 38

When you declare a derived class object, this object inherits the members of the base class, but the derived class object cannot directly access the ____.

A.

private data members of the base class

B.

data members in its own class

C.

base class constructors

Question 39

In a shallow copy, two pointers of different data types point to the same memory.

True

False

Question 40

The statement vecList.push_back(elem) deletes the element elem from the vector.

True

False

Question 1

The syntax for accessing a class (struct) member using the operator

-

> is ____.

A.

pointerVariableName.classMemberName

B.

pointerVariableName

-

>classMemberName

C.

pointerVariableName&

-

>classMemberName

Question 2

Operations,

such as finding the height, determining the number of nodes, checking whether the tree

is empty, tree traversal, and so on, on AVL trees cannot be implemented the same way they are

implemented on binary trees.

True

False

Question 3

The expression ve

cCont.empty() empties the vector container of all elements.

True

False

Question 4

Because a queue is an important data structure, the Standard Template Library (STL) provides a

class to implement queues in a program.

Question 1

The syntax for accessing a class (struct) member using the operator -> is ____.

A.

pointerVariableName.classMemberName

B.

pointerVariableName->classMemberName

C.

pointerVariableName&->classMemberName

Question 2

Operations, such as finding the height, determining the number of nodes, checking whether the tree

is empty, tree traversal, and so on, on AVL trees cannot be implemented the same way they are

implemented on binary trees.

True

False

Question 3

The expression vecCont.empty() empties the vector container of all elements.

True

False

Question 4

Because a queue is an important data structure, the Standard Template Library (STL) provides a

class to implement queues in a program.