Skip to content

Commit 4d8d8c8

Browse files
committed
CircularQueueLinkedList: missing type hints #5361
1 parent 2a07f99 commit 4d8d8c8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

data_structures/queue/circular_queue_linked_list.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class CircularQueueLinkedList:
1717
Exception: Full Queue
1818
"""
1919

20-
def __init__(self, initial_capacity: int = 6):
20+
def __init__(self, initial_capacity: int = 6) -> None:
2121
self.front = None
2222
self.rear = None
2323
self.create_linked_list(initial_capacity)
2424

25-
def create_linked_list(self, initial_capacity):
25+
def create_linked_list(self, initial_capacity) -> None:
2626
current_node = Node()
2727
self.front = current_node
2828
self.rear = current_node
@@ -76,7 +76,7 @@ def first(self) -> Any:
7676
self.check_can_perform_operation()
7777
return self.front.data
7878

79-
def enqueue(self, data: Any):
79+
def enqueue(self, data: Any) -> None:
8080
"""
8181
Saves data at the end of the queue
8282
@@ -128,17 +128,17 @@ def dequeue(self) -> Any:
128128
old_front.data = None
129129
return data
130130

131-
def check_can_perform_operation(self):
131+
def check_can_perform_operation(self) -> None:
132132
if self.is_empty():
133133
raise Exception("Empty Queue")
134134

135-
def check_is_full(self):
135+
def check_is_full(self) -> None:
136136
if self.rear.next == self.front:
137137
raise Exception("Full Queue")
138138

139139

140140
class Node:
141-
def __init__(self):
141+
def __init__(self) -> None:
142142
self.data = None
143143
self.next = None
144144
self.prev = None

0 commit comments

Comments
 (0)