-
-
Save alexnikol/49c3eaa36cbf274052fd9861baca5ca4 to your computer and use it in GitHub Desktop.
Insert a Node at the Tail of a Linked List. Testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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