* Typo?

newNod -> newNode

* newNode -> new_node

Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Logan Lieou 2020-01-14 03:21:02 -06:00 committed by Christian Clauss
parent 56e7ae01d2
commit d09a805804

View File

@ -21,10 +21,10 @@ class LinkedList:
temp.next = Node(data) # create node & link to tail
def insert_head(self, data) -> None:
newNod = Node(data) # create a new node
new_node = Node(data) # create a new node
if self.head:
newNod.next = self.head # link newNode to head
self.head = newNod # make NewNode as head
new_node.next = self.head # link new_node to head
self.head = new_node # make NewNode as head
def print_list(self) -> None: # print every node data
temp = self.head