Solved

Example Code Ch 13-4

Question 22

Multiple Choice

Example Code Ch 13-4
Assume that a linked list consists of Node objects, where Node has two instance data, int info and Node next. The linked list stores in the info data, 20, 11, 13, 19, 12, 14 in that order. Assume that Node head references the first item in the list.
-Refer to Example Code Ch 13-4: What is the result to the linked list of the following instructions? Assume that newNode is a Node, already constructed. newNode.data = 1;
NewNode.next = head.next;
Head.next = newNode;


A) The value 1 is inserted into the linked list before 20.
B) The value 1 is inserted into the linked list after 20 and before 11.
C) The value 1 is inserted into the linked list after 11 and before 13.
D) The value 1 is inserted into the linked list after 13 and before 19.
E) The value 1 is inserted into the linked list after 20 and the rest of the list is lost.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents