mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Typo? (#1653)
* Typo? newNod -> newNode * newNode -> new_node Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
56e7ae01d2
commit
d09a805804
|
@ -21,10 +21,10 @@ class LinkedList:
|
||||||
temp.next = Node(data) # create node & link to tail
|
temp.next = Node(data) # create node & link to tail
|
||||||
|
|
||||||
def insert_head(self, data) -> None:
|
def insert_head(self, data) -> None:
|
||||||
newNod = Node(data) # create a new node
|
new_node = Node(data) # create a new node
|
||||||
if self.head:
|
if self.head:
|
||||||
newNod.next = self.head # link newNode to head
|
new_node.next = self.head # link new_node to head
|
||||||
self.head = newNod # make NewNode as head
|
self.head = new_node # make NewNode as head
|
||||||
|
|
||||||
def print_list(self) -> None: # print every node data
|
def print_list(self) -> None: # print every node data
|
||||||
temp = self.head
|
temp = self.head
|
||||||
|
|
Loading…
Reference in New Issue
Block a user