Filters
Question type

Study Flashcards

The steps involved in inserting a new item at the beginning of an unordered linked list are ____.


A) 1.Create a new node.
2.Insert the node before first.
3.Increment the counter by 1.
B) 1.Create a new node.
2.Store the new item in the new node.
3.Insert the node before first.
4.Increment the counter by 1.
C) 1.Create a new node.
2.Store the new item in the new node.
3.Insert the node before first.
D) 1.Create a new node.
2.Store the new item in the new node.
3.Insert the node before first.
4.Decrement the counter by 1.

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

Each node of a linked list must store the data as well as the ____________________ of the next node in the list.

Correct Answer

verifed

verified

A linked list is a random access data structure.

A) True
B) False

Correct Answer

verifed

verified

Every node in a doubly linked list has two pointers: ____ and ____.


A) top; bottom
B) back; next
C) current; forward
D) previous; forward

E) All of the above
F) B) and D)

Correct Answer

verifed

verified

B

A(n) ____________________ is an object that produces each element of a container, such as a linked list, one element at a time.

Correct Answer

verifed

verified

  -Consider the accompanying statements.The operation returns true if the list is empty; otherwise, it returns false.The missing code is ____. A)  protected B)  int C)  void D)  bool -Consider the accompanying statements.The operation returns true if the list is empty; otherwise, it returns false.The missing code is ____.


A) protected
B) int
C) void
D) bool

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

You can use the pointer head of a linked list to traverse the list.

A) True
B) False

Correct Answer

verifed

verified

Because each node of a linked list has two components, we need to declare each node as a(n) ____.


A) reference and string
B) int and object
C) index and element
D) class or struct

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

The ____________________ constructor executes when an object is declared and initialized using another object.

Correct Answer

verifed

verified

A linked list is a collection of components, called ____.


A) elements
B) nodes
C) members
D) pointers

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

When building a linked list in the ____ manner, a new node is always inserted at the end of the linked list.


A) backward
B) forward
C) traversal
D) random

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

B

For classes that include pointer data members, the assignment operator must be explicitly ____________________.

Correct Answer

verifed

verified

The ____ deallocates the memory occupied by the nodes of a list when the class object goes out of scope.


A) constructor
B) destructor
C) head pointer
D) tail pointer

E) All of the above
F) B) and D)

Correct Answer

verifed

verified

Which of the following is a basic operation on singly linked lists?


A) Retrieve the data of an arbitrary node.
B) Swap the head and the last nodes.
C) Determine whether the list is nearly full.
D) Make a copy of the linked list.

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

When you build a linked list in the backward manner, a new node is always inserted at the end of the linked list.

A) True
B) False

Correct Answer

verifed

verified

What is the purpose of the following code? What is the purpose of the following code?   A)  Insertion of a node B)  Selection of a node C)  Traversal of a linked list D)  Creation of a new list


A) Insertion of a node
B) Selection of a node
C) Traversal of a linked list
D) Creation of a new list

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

Consider the following code which deletes all the nodes in a linked list. Consider the following code which deletes all the nodes in a linked list.   Which of the following is the missing statement? A)  delete first; B)  delete temp; C)  destroy temp; D)  clear temp; Which of the following is the missing statement?


A) delete first;
B) delete temp;
C) destroy temp;
D) clear temp;

E) B) and D)
F) None of the above

Correct Answer

verifed

verified

In a linked list, if a new item is always inserted at the beginning or at the end of the list and the data we read is unsorted, the linked list will be unsorted.

A) True
B) False

Correct Answer

verifed

verified

True

Each node of a singly linked list has two components: ____ and ____.


A) info, head
B) link, back
C) back, head
D) info, link

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

In a linked list, the order of the nodes is determined by the address, called the ____, stored in each node.


A) head
B) tail
C) link
D) first

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

Showing 1 - 20 of 40

Related Exams

Show Answer