Fill This Form To Receive Instant Help
Homework answers / question archive / Which XXX completes the insert_after() method in the Python LinkedList class for a singly-linked list? def insert_after(self, current_node, new_node): if self
Which XXX completes the insert_after() method in the Python LinkedList class for a singly-linked list?
def insert_after(self, current_node, new_node): if self.head == None: self.head = new_node self.tail = new_node elif current_node is self.tail: self.tail.next = new_node self.tail = new_node else: XXX
As we insert new node in the middle of a linked list, next next of current node is made as next node of new node, and next next of current node is new node. Xxxx=>new_node.next=current_node.next