Can anyone help me with this problem?
Question 3
4pts
Consider the following Node class and the Driver class. In the Driver class, a linked list of Node is created. What would be the order of the fruit names from left to right? Assume that the node n3 is the head of the list.
Enter your answers with the correct spelling; otherwise, it will be marked as incorrect.
class Node {
String name;
Node next;
public Node(String name) {
this.name = name;
}
}
class Driver {
public static void main(String[] args) {
Node n1 = new Node("Orange");
Node n2 = new Node("Apple");
Node n3 = new Node("Tangerine");
n3.next = n2;
n2.next = n1;
Node n4 = new Node("Kiwi");
n1.next = n4;
}
}
Enter your answer. Make sure to use the exact given spellings for the names; otherwise, your answer will be marked as incorrect.