Question: Which XXX completes the following algorithm for inserting a new node after curNode in a singly-linked list? A call to insertAfter (list, null, newNode) would

 Which XXX completes the following algorithm for inserting a new node

Which XXX completes the following algorithm for inserting a new node after curNode in a singly-linked list? A call to insertAfter (list, null, newNode) would prepend to the list. insertAfter(list, curNode, newNode) { if (list.head == null) { list.head = newlode list.tail = newNode 1 else if (curNode == list.tail) { list.tail.next = newNode list.tail = newNode } else { } 1 Answers: newNode.next = curNode.next curNode.next = null a. newNode.next = null curNode.next = list.tail.next b. newNode.next = curNode.next curNode = newNode C. newNode.next = curNode.next curNode.next = newNode d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!