There was an error while loading. Please reload this page.
1 parent 1556c4a commit 7779103Copy full SHA for 7779103
python/06_linkedlist/singlyLinkedList.py
@@ -146,7 +146,7 @@ def delete_by_node(self, node):
146
not_found = False # 如果在整个链表中都没有找到指定删除的Node节点,则该标记量设置为True
147
while pro.next != node:
148
if pro.next == None: # 如果已经到链表的最后一个节点,则表明该链表中没有找到指定删除的Node节点
149
- not_found == True
+ not_found = True
150
break
151
else:
152
pro = pro.next
@@ -169,7 +169,7 @@ def delete_by_value(self, value):
169
not_found = False
170
while node.data != value:
171
if node.next == None: # 如果已经到链表的最后一个节点,则表明该链表中没有找到执行Value值的Node节点
172
173
174
175
pro = node
0 commit comments