Requires Respondus LockDown Browser
Time Left:0:21:08
Garry Butts: Attempt 1
Question 6 (10 points)
Suppose you have the following singly linked list Node and LinkedList classes, answer the following
three questions. You don't need to write the classes again, just complete the
requirements.
public class Node {
int id;
Node next;
public Node (int id) {this.id = id;
}
public class LinkedList {
Node head;
LinkedList() { head = null;
}
public boolean isEmpty() { return (head == null);
}
public void append(int id)
{
/* Codes go here */
}
public void prepend(int id)
{
/* Codes go here */
}
// End of the LinkedList class
Considering an initial empty LinkedList object, write only the common codes in the
prepend(int id) and append(int id) methods using Java or C# (no pseudocode
allowed