Created
June 19, 2022 02:31
-
-
Save wanderindev/ccb850aea62d5395ae7bc2c5c0d69a58 to your computer and use it in GitHub Desktop.
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
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