mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-12 07:31:52 +08:00
Remove Multiple Unused Imports and Variable
This commit is contained in:
@ -24,7 +24,7 @@ class LinkedList:
|
||||
temp = self.head
|
||||
self.head = self.head.next # oldHead <--> 2ndElement(head)
|
||||
self.head.previous = None # oldHead --> 2ndElement(head) nothing pointing at it so the old head will be removed
|
||||
if(self.head == None):
|
||||
if(self.head is None):
|
||||
self.tail = None
|
||||
return temp
|
||||
|
||||
@ -58,7 +58,7 @@ class LinkedList:
|
||||
current.next.previous = current.previous # 1 <--> 3
|
||||
|
||||
def isEmpty(self): #Will return True if the list is empty
|
||||
return(self.head == None)
|
||||
return(self.head is None)
|
||||
|
||||
def display(self): #Prints contents of the list
|
||||
current = self.head
|
||||
|
@ -19,4 +19,4 @@ class LinkedList:
|
||||
return item
|
||||
|
||||
def is_empty(self):
|
||||
return self.head == None
|
||||
return self.head is None
|
||||
|
@ -67,3 +67,4 @@ class Linked_List:
|
||||
current = next_node
|
||||
# Return prev in order to put the head at the end
|
||||
Head = prev
|
||||
return Head
|
||||
|
Reference in New Issue
Block a user