Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A linked list is a series of connected _______. ADT\'s vectors algorithms nodes

ID: 3593758 • Letter: A

Question

A linked list is a series of connected _______.

ADT's

vectors

algorithms

nodes

None of these

1 points   

QUESTION 2

A doubly-linked list keeps track of the next node in the list, as well as:

itself

the head node

the tail node

the previous node

1 points   

QUESTION 3

A dynamic stack has a ___________ size, and is implemented as a(n) ________

variable, linked list

fixed, linked list

variable, array

fixed, array

1 points   

QUESTION 4

A linked list class must take care of removing the dynamically allocated nodes. This is done by ________________.

the constructor function

the destructor function

overriding the removal function

overloading the memory persistence operator

1 points   

QUESTION 5

A queue is a data structure that stores and retrieves items in this manner.

last in, first out

first in, first out

first in, last out

random

1 points   

QUESTION 6

A static queue can be implemented as a(n) ___________.

circular array

stack

dynamic linked list

dynamic vector

1 points   

QUESTION 7

A(n) _________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

array

queue

stack

vector

1 points   

QUESTION 8

Deleting a node is a ______________ step process

one -- delete the node from memory

two -- remove the node without breaking links, then delete it from memory

three -- create a blank node, remove the node being deleted, insert the blank, then delete the node

four -- create a blank, remove the node being deleted, insert the blank, delete the node, delete the blank

1 points   

QUESTION 9

If the head pointer points to NULL, this indicates

the list has been previously created and then destroyed

the list needs to be destroyed

there are no nodes in the list

the list is full and cannot accept any new nodes

1 points   

QUESTION 10

In the following code, assume the myQueue object is a queue that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1:   myQueue.enqueue(0);

2:   myQueue.enqueue(1);

3:   myQueue.enqueue(2);

4: value = myQueue.dequeue();

5:   cout << value << endl;

Assume that the dequeue function, called in line 4, stores the number removed from the queue in the value variable.

What will the statement in line 5 display?

0

1

2

none of these

1 points   

QUESTION 11

In the following code, assume the myQueue object is a queue that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1:   myQueue.enqueue(0);

2:   myQueue.enqueue(1);

3:   myQueue.enqueue(2);

4: value = myQueue.dequeue();

5:   myQueue.enqueue(3);

6:   value =  myQueue.dequeue();

7:   cout << value << endl;

Assume that the dequeue function, called in lines 4, and 6, stores the number removed from the queue in the value variable.

What will the statement in line 7 display?

0

1

2

3

1 points   

QUESTION 12

In the following code, assume the myStack object is a stack that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1:   myStack.push(0);

2:   myStack.push(1);

3:   myStack.push(2);

4: value = myStack.pop();

5: value = myStack.pop();

6: value = myStack.pop();

7:   cout << value << endl;

Assume that the pop function, called in lines 4, 5, and 6, stores the number popped from the stack in the value variable.

What will the statement in line 7 display?

0

2

1

none of these

1 points   

QUESTION 13

In the following code, assume the myStack object is a stack that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1:   myStack.push(0);

2:   myStack.push(1);

3:   myStack.push(2);

4:   myStack.pop(value);

5:   myStack.push(3);

6:   value =  myStack.pop();

7:   cout << value << endl;

Assume that the pop function, called in lines 4 and 6, stores the number popped from the stack in the value variable.

What will the statement in line 7 display?

0

1

2

3

1 points   

QUESTION 14

The _______ operation allows an item to be stored on a stack.

append

add

pop

push

1 points   

QUESTION 15

The ________ of a linked list points to the first node in the list.

starter

head

tail

declaration

none of these

1 points   

QUESTION 16

The ___________ operation allows an item to be removed from a stack.

push

pop

delete

remove

1 points   

QUESTION 17

The advantage a linked list has over an array is:

A linked list is smaller than an array

A node can be inserted into or removed from a linked list without shifting

Data removal and insertion are more accurate with a linked list than with an array

1 points   

QUESTION 18

The last node in a linked list points to ______.

null address

previous node

the first node

nothing. It does not contain a pointer

1 points   

QUESTION 19

Two primary queue operations are:

push and pop

enqueue and dequeue

insert and delete

onqueue and offqueue

1 points   

QUESTION 20

While traversing a list, a node pointer knows when it has reached the end of a list when:

it encounters the newline character

it encounters NULL

it finds itself back at the beginning of the list

it encounters a sentinel, usually 9999

ADT's

vectors

algorithms

nodes

None of these

Explanation / Answer

1) A linked list is a series of connected ________

Answer) Nodes

2) A doubly-linked list keeps track of the next node in the list, as well as:

Answer) the previous node

3) A dynamic stack has a ___________ size, and is implemented as a(n) ________

Answer) variable, linked list

4) A linked list class must take care of removing the dynamically allocated nodes. This is done by

Answer) the destructor function

5) A queue is a data structure that stores and retrieves items in this manner

Answer) first in, first out

6) A static queue can be implemented as a(n) ___________

Answer) circular array

7) A(n) _________ is an abstract data type that stores and retrieves items in a last-in-first-out

Answer) stack

8) Deleting a node is a ______________ step process

Answer) two -- remove the node without breaking links, then delete it from memory

9) If the head pointer points to NULL, this indicates

Answer) there are no nodes in the list

10) In the following code, assume the myQueue object is a queue that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1: myQueue.enqueue(0);

2: myQueue.enqueue(1);

3: myQueue.enqueue(2);

4: value = myQueue.dequeue();

5: myQueue.enqueue(3);

6: value = myQueue.dequeue();

7: cout << value << endl;

Assume that the dequeue function, called in lines 4, and 6, stores the number removed from the queue in the value variable.

What will the statement in line 7 display?

Answer) 2

11) In the following code, assume the myQueue object is a queue that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1: myQueue.enqueue(0);

2: myQueue.enqueue(1);

3: myQueue.enqueue(2);

4: value = myQueue.dequeue();

5: myQueue.enqueue(3);

6: value = myQueue.dequeue();

7: cout << value << endl;

Assume that the dequeue function, called in lines 4, and 6, stores the number removed from the queue in the value variable.

What will the statement in line 7 display?

Answer) 1

12) In the following code, assume the myStack object is a stack that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1: myStack.push(0);

2: myStack.push(1);

3: myStack.push(2);

4: value = myStack.pop();

5: value = myStack.pop();

6: value = myStack.pop();

7: cout << value << endl;

Assume that the pop function, called in lines 4, 5, and 6, stores the number popped from the stack in the value variable.

What will the statement in line 7 display?

Answer) 0

13) In the following code, assume the myStack object is a stack that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)

1: myStack.push(0);

2: myStack.push(1);

3: myStack.push(2);

4: myStack.pop(value);

5: myStack.push(3);

6: value = myStack.pop();

7: cout << value << endl;

Assume that the pop function, called in lines 4 and 6, stores the number popped from the stack in the value variable.

What will the statement in line 7 display?

Answer) 3

14) The _______ operation allows an item to be stored on a stack.

Answer) push

15) The ________ of a linked list points to the first node in the list.

Answer) head

16) The ___________ operation allows an item to be removed from a stack.

Answer) pop

17) The advantage a linked list has over an array is:

Answer) A node can be inserted into or removed from a linked list without shifting

18) The last node in a linked list points to ______.

Answer) null address

19) Two primary queue operations are:

Answer) insert and delete

20) While traversing a list, a node pointer knows when it has reached the end of a list when:

Answer) it encounters NULL

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote