Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Created August 10, 2020 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexnikol/49c3eaa36cbf274052fd9861baca5ca4 to your computer and use it in GitHub Desktop.
Save alexnikol/49c3eaa36cbf274052fd9861baca5ca4 to your computer and use it in GitHub Desktop.
Insert a Node at the Tail of a Linked List. Testing
# RESULT
node1 = SinglyLinkedListNode(1)
node2 = SinglyLinkedListNode(2)
node3 = SinglyLinkedListNode(3)
node1.next = node2
node2.next = node3
result = insertNodeAtTail(node1, 34)
current_node = result
while current_node is not None:
print(current_node.data)
current_node = current_node.next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment