From 02e7f0dd604b47d300dfd54486d60b6e70f618b8 Mon Sep 17 00:00:00 2001 From: vprusso Date: Wed, 8 May 2019 09:25:32 -0400 Subject: [PATCH] fixed code bug to delete at 1 --- .../linked_list/singularly_linked_list/linked_list_deletion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/linked_list/singularly_linked_list/linked_list_deletion.py b/data_structures/linked_list/singularly_linked_list/linked_list_deletion.py index 5cb25aa..5061a2d 100644 --- a/data_structures/linked_list/singularly_linked_list/linked_list_deletion.py +++ b/data_structures/linked_list/singularly_linked_list/linked_list_deletion.py @@ -74,7 +74,7 @@ def delete_node_at_pos(self, pos): return prev = None - count = 1 + count = 0 while cur_node and count != pos: prev = cur_node cur_node = cur_node.next