mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-17 03:07:35 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
00086389ad
commit
b7fef5c169
@ -113,7 +113,7 @@ class SortedLinkedList:
|
|||||||
>>> linkedList.insert(57)
|
>>> linkedList.insert(57)
|
||||||
>>> linkedList.insert(45)
|
>>> linkedList.insert(45)
|
||||||
>>> linkedList.display()
|
>>> linkedList.display()
|
||||||
32 45 57
|
32 45 57
|
||||||
"""
|
"""
|
||||||
temp: Node | None = self.head
|
temp: Node | None = self.head
|
||||||
while temp:
|
while temp:
|
||||||
@ -141,11 +141,11 @@ class SortedLinkedList:
|
|||||||
>>> linkedList.insert(57)
|
>>> linkedList.insert(57)
|
||||||
>>> linkedList.insert(45)
|
>>> linkedList.insert(45)
|
||||||
>>> linkedList.display()
|
>>> linkedList.display()
|
||||||
32 45 57
|
32 45 57
|
||||||
>>> linkedList.delete(45)
|
>>> linkedList.delete(45)
|
||||||
True
|
True
|
||||||
>>> linkedList.display()
|
>>> linkedList.display()
|
||||||
32 57
|
32 57
|
||||||
"""
|
"""
|
||||||
if self.head is None:
|
if self.head is None:
|
||||||
return False
|
return False
|
||||||
@ -166,7 +166,7 @@ class SortedLinkedList:
|
|||||||
self.num_nodes -= 1
|
self.num_nodes -= 1
|
||||||
return True
|
return True
|
||||||
temp_node = temp_node.next_node
|
temp_node = temp_node.next_node
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def search(self, data: int) -> bool:
|
def search(self, data: int) -> bool:
|
||||||
@ -295,10 +295,10 @@ class SortedLinkedList:
|
|||||||
>>> linkedList.insert(45)
|
>>> linkedList.insert(45)
|
||||||
>>> linkedList.insert(45)
|
>>> linkedList.insert(45)
|
||||||
>>> linkedList.display()
|
>>> linkedList.display()
|
||||||
32 45 45 57
|
32 45 45 57
|
||||||
>>> linkedList.remove_duplicates()
|
>>> linkedList.remove_duplicates()
|
||||||
>>> linkedList.display()
|
>>> linkedList.display()
|
||||||
32 45 57
|
32 45 57
|
||||||
"""
|
"""
|
||||||
|
|
||||||
temp: Node | None = self.head
|
temp: Node | None = self.head
|
||||||
|
Loading…
x
Reference in New Issue
Block a user