Skip to content

Commit a88ad60

Browse files
author
cclauss
authored
Update singly_LinkedList.py
1 parent d043448 commit a88ad60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

data_structures/LinkedList/singly_LinkedList.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def __int__(self, data):
99

1010
class Linked_List:
1111
def insert_tail(Head, data):
12-
if(Head.next is None):
12+
if Head.next is None:
1313
Head.next = Node(data)
1414
else:
1515
Head.next.insert_tail(data)
@@ -43,7 +43,7 @@ def delete_tail(Head): # delete from tail
4343
if Head is not None:
4444
tamp = Node()
4545
tamp = Head
46-
while (tamp.next).next is not None: # find the 2nd last element
46+
while tamp.next.next is not None: # find the 2nd last element
4747
tamp = tamp.next
4848
# delete the last element by give next None to 2nd last Element
4949
tamp.next = None
@@ -56,7 +56,7 @@ def reverse(Head):
5656
prev = None
5757
current = Head
5858

59-
while(current):
59+
while current:
6060
# Store the current node's next node.
6161
next_node = current.next
6262
# Make the current node's next point backwards

0 commit comments

Comments
 (0)