So I absolutely cannot figure out nodes. I have no clue what I am doing. I can't figure out how to do the add method. So far all I have is:
public class List{ Node head = null; //the start of the linked list private public void add(Object next, int index){ if(head == null){ //adding to an empty list (changes head) head = new Node(next, head); //what about index? }else if( ){ //adding to a single element list (changes head) }else if(){ //adding to a populated list (n>=2) Node temp = head; while(temp.next != null){ temp = temp.next; } temp.next = new Node(next, index) //not correct..... } } }