Skip to content

Instantly share code, notes, and snippets.

@wanderindev
Created June 19, 2022 02:31
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 wanderindev/ccb850aea62d5395ae7bc2c5c0d69a58 to your computer and use it in GitHub Desktop.
Save wanderindev/ccb850aea62d5395ae7bc2c5c0d69a58 to your computer and use it in GitHub Desktop.
def add_front(self, new_data: Any) -> None:
"""Add a node to the front of the linked list"""
new_node = Node(new_data)
new_node.next_node = self.head
self.head = new_node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment