We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ad4e86 commit 552e7c1Copy full SHA for 552e7c1
docs/03_链表/linked_list.py
@@ -188,6 +188,12 @@ def test_linked_list_remove():
188
ll.remove(7)
189
print(list(ll))
190
191
+def test_single_node():
192
+ ll = LinkedList()
193
+ ll.append(0)
194
+ ll.remove(0)
195
+ ll.appendleft(1)
196
+ assert list(ll) == [1]
197
198
def test_linked_list_reverse():
199
ll = LinkedList()
@@ -206,6 +212,7 @@ def test_linked_list_append():
206
212
207
213
208
214
if __name__ == '__main__':
215
+ test_single_node()
209
216
test_linked_list()
210
217
test_linked_list_append()
211
218
test_linked_list_reverse()
0 commit comments