Question: Which XXX completes the prepend ( ) method in the Python LinkedList class for a singly - linked list? def prepend ( self , new

Which XXX completes the prepend() method in the Python LinkedList class for a singly-linked list?
def prepend(self, new_node):
if self.head == None:
self.head = new_node
self.tail = new_node
else:
XXX
self.head = new_node
a) self.tail = new_node
b) self.head.next = new_node
c) new_node.next = self.head
d) new_node = self.head

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 Programming Questions!