Skip to content

Commit a2f542e

Browse files
authored
doubly_linked_list.py: Add doctests
1 parent 1e8fe8e commit a2f542e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

data_structures/linked_list/doubly_linked_list.py

+12
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010

1111

1212
class LinkedList: # making main class named linked list
13+
"""
14+
>>> linked_list = LinkedList()
15+
>>> linked_list.insert_head("a")
16+
>>> linked_list.insert_tail("b")
17+
>>> _ = linked_list.delete_tail()
18+
>>> linked_list.isEmpty()
19+
True
20+
>>> linked_list.delete_head()
21+
None
22+
>>> linked_list.isEmpty()
23+
False
24+
"""
1325
def __init__(self):
1426
self.head = None
1527
self.tail = None

0 commit comments

Comments
 (0)