You are viewing a single comment's thread. Return to all comments →
def insertNodeAtPosition(llist, data, position): node = llist for _ in range(position - 1): node = node.next _next = node.next new = SinglyLinkedListNode(data) node.next, new.next = new, _next return llist
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 →