Solved

The Linked List Iterator Described in the Textbook Maintains a Reference

Question 3

Multiple Choice

The linked list iterator described in the textbook maintains a reference to the last visited node, called position, and a reference to the last node before that, called previous.Which of the following statements is NOT correct regarding advancing this iterator?


A) If another node exists, when the iterator is to be advanced, the position reference must be updated to position.next.
B) If the iterator currently points before the first element of the list, when the iterator is to be advanced, position must be set to point to the first node in the linked list.
C) If another node exists, when the iterator is to be advanced, the previous reference must be updated to point to the current location of the iterator
D) If the iterator currently points before the first element of the list, when the iterator is to be advanced, the position reference must be set to position.next and the previous reference must be set to point to the first node in the linked list.

Correct Answer:

verifed

Verified

Related Questions