A linked list class uses a Node class to represent nodes. A private recursive method Node add(int index, E element, Node list) takes a reference list (referring to the first in a chain of Node objects), adds a node containing the given element at the given index, and returns a reference to the first node of the resulting chain. Assume that index is nonnegative and is less than or equal to the size of list. Under these circumstances, the add method should handle its base case (index is 0) by

A) returning list
B) adding a new node containing element to the front of list and returning a reference to the newly added node
C) adding a new node containing element to the front of list and returning list
D) adding a new node containing element to the end of list

B) adding a new node containing element to the front of list and returning a reference to the newly added node

Computer Science & Information Technology

You might also like to view...

Which port is the most common port used to connect input and output devices?

A) Parallel B) Universal serial bus (USB) C) FireWire D) Ethernet

Computer Science & Information Technology

________ testing is how much did the user remember after a period of non-use

A) Emotional response B) Accuracy C) Recall D) Performance

Computer Science & Information Technology