Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Last active August 12, 2020 07:07
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/b93df3e6aa45ce591a8c38e60a078c8d to your computer and use it in GitHub Desktop.
Save alexnikol/b93df3e6aa45ce591a8c38e60a078c8d to your computer and use it in GitHub Desktop.
Insert a node at the head of a linked list. Realization
from linked_list import SinglyLinkedListNode
def insertNodeAtHead(llist, data):
node = SinglyLinkedListNode(data)
node.next = llist
return node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment