Question: Which XXX completes the insertAfter() method in the Java LinkedList class for a doubly-linked list? public void insertAfter (Node currentNode, Node newNode) { if (m_head

Which XXX completes the insertAfter() method in the Java LinkedList class for a doubly-linked list? public void insertAfter (Node currentNode, Node newNode) { if (m_head == null) { m_head = newNode; m_tail = newNode; } else if (currentNode m_tail) { m_tail.next = newNode; newNode.previous = m_tail; m_tail = newNode; } else { Node successor = currentNode.next; newNode.next = successor; newNode.previous = currentNode; currentNode.next = newNode; XXX } } O successor.next = newlode; O successor.previous = newNode; O currentNode.previous = successor; O currentNode.previous newNode
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
