For a non-empty linked list, select the code that should appear in a function that adds a node to the end of the list. newPtr is a pointer to the new node to be added, and lastPtr is a pointer to the current last node. Each node contains a pointer nextPtr, a link to a node.
a)
lastPtr->nextPtr = newPtr;
lastPtr = newPtr;
b)
lastPtr = newPtr;
lastPtr->nextPtr = newPtr;
c)
newPtr->nextPtr = lastPtr;
lastPtr = newPtr;
d)
lastPtr = newPtr;
newPtr->nextPtr = lastPtr;
a)
lastPtr->nextPtr = newPtr;
lastPtr = newPtr;
You might also like to view...
________ is an example of a serif font
A) Cambria B) Verdana C) Calabri D) Arial
To create an Inbox Rule in Outlook Web App, select the email for which you wish to create a rule, click the More actions button above the viewing pane, and then click create rule
Indicate whether the statement is true or false
A cache is typically ____ times faster than RAM but possesses less storage capacity.
A. 5 to 10 B. 15 to 20 C. 20 to 30 D. 25 to 30
A computer-based IS that provides a flexible tool for analysis and helps managers focus on the future is____.
A. TPS B. MIS C. DSS D. ESS