You are viewing a single comment's thread. Return to all comments →
Python Solution:
def insertNodeAtPosition(llist, data, position): new_node = SinglyLinkedListNode(data) nodes = [] node = llist while node: nodes.append(node) node = node.next new_node.next = nodes[position - 1].next nodes[position - 1].next = new_node return nodes[0]
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a node at a specific position in a linked list
You are viewing a single comment's thread. Return to all comments →
Python Solution: