You are viewing a single comment's thread. Return to all comments →
kinda wish you could thumbs-down the questions that pretend to cater to some languages and just don't. I guess it's python again then...
def insertNodeAtPosition(llist, data, position): newNode = SinglyLinkedListNode(data) if position == 0: newNode.next = llist return newNode insertAt = llist while position > 1: position-=1 insertAt = insertAt.next newNode.next = insertAt.next insertAt.next = newNode 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 →
kinda wish you could thumbs-down the questions that pretend to cater to some languages and just don't. I guess it's python again then...