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.

Computer Science & Information Technology

You might also like to view...

In Access, what view displays the detailed structure of the table?

A) Preview B) SQL C) Datasheet D) Design

Computer Science & Information Technology

In Visual Basic, a(n) ________ is an action occurring at run time that triggers a program instruction

A) event B) method C) property D) characteristic

Computer Science & Information Technology

Management should coordinate the organization's information security vision and objectives with the communities of ____________________ involved in the execution of the plan.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following statements about character input is false?

A. Characters can be read or written only to the standard streams. B. getchar reads the next character from the standard input stream. C. fgetc can read a character from the standard input stream or a user-specified stream. D. For technical reasons, fgetc is preferred over getc. E. ungetc pushes a character back into the input stream.

Computer Science & Information Technology