This was the add method we wrote in class without using the dummy nodes at the front and back of the list. The complexity of this code is similar to what you might see on the final, but the final exam will not have a back field to worry about and it won't be a doubly-linked list (with next and prev references), it will only be singly-linked (with next references). When I tried to write this code, I made mistakes until I took it slowly and drew pictures. Please draw pictures when you study and take the exam! ListNode newNode; if (index == 0) { newNode = new ListNode(value, front, null); front = newNode; if (newNode.next != null) { newNode.next.prev = newNode; } } else { ListNode current = nodeAt(index - 1); newNode = new ListNode(value, current.next, current); current.next = newNode; if (newNode.next != null) { newNode.next.prev = newNode; } } if (index == size) { back = newNode; } size++