From 74c44c7f1f6674853056bec4b7d6bca9594fbd06 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:25:25 +0000 Subject: [PATCH 1/2] Refactor useless `else` block in the loop --- .../LInked List/linked_lists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py b/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py index f8f5d28..7869c03 100644 --- a/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py +++ b/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py @@ -28,8 +28,8 @@ def search(self, x): # SEARCH ELEMENT if temp.data == x: return True temp = temp.next - else: - return False + + return False def delete_node(self, data): # NOT WORKS temp = self.head From 2aa0235ec1058fb3ab5fbef8de5840ee03880e4f Mon Sep 17 00:00:00 2001 From: azam <79155097+azamtoiri@users.noreply.github.com> Date: Tue, 18 Oct 2022 21:27:20 +0300 Subject: [PATCH 2/2] Update linked_lists.py --- .../LInked List/linked_lists.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py b/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py index 7869c03..88c099c 100644 --- a/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py +++ b/Algorithms/algorithms_with_data_structures/LInked List/linked_lists.py @@ -28,7 +28,6 @@ def search(self, x): # SEARCH ELEMENT if temp.data == x: return True temp = temp.next - return False def delete_node(self, data): # NOT WORKS @@ -74,4 +73,4 @@ def delete_tail(self): # DELETE TAIL print("\nDelete Tail ") family.delete_tail() -family.traversal() \ No newline at end of file +family.traversal()