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. 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...
What are the two sets in Dijkstra's algorithm?
a. The data structure used to process each vertex b. A hash table data structure to store vertex and edge information c. Two linked list data structures d. Two stacks that hold the vertices and edges
A(n) _________ query can add, delete, or modify records in a table
Fill in the blank(s) with correct word
Building two parse trees implies that the parser has demonstrated correctness in two different ways. _________________________
Answer the following statement true (T) or false (F)
To sort data using the shortcut method, ____ a cell value on which you want to sort, point to Sort, then click the appropriate option.
A. click B. right-click C. double-click D. point to