@@ -17,12 +17,12 @@ class CircularQueueLinkedList:
17
17
Exception: Full Queue
18
18
"""
19
19
20
- def __init__ (self , initial_capacity : int = 6 ):
20
+ def __init__ (self , initial_capacity : int = 6 ) -> None :
21
21
self .front = None
22
22
self .rear = None
23
23
self .create_linked_list (initial_capacity )
24
24
25
- def create_linked_list (self , initial_capacity ):
25
+ def create_linked_list (self , initial_capacity ) -> None :
26
26
current_node = Node ()
27
27
self .front = current_node
28
28
self .rear = current_node
@@ -76,7 +76,7 @@ def first(self) -> Any:
76
76
self .check_can_perform_operation ()
77
77
return self .front .data
78
78
79
- def enqueue (self , data : Any ):
79
+ def enqueue (self , data : Any ) -> None :
80
80
"""
81
81
Saves data at the end of the queue
82
82
@@ -128,17 +128,17 @@ def dequeue(self) -> Any:
128
128
old_front .data = None
129
129
return data
130
130
131
- def check_can_perform_operation (self ):
131
+ def check_can_perform_operation (self ) -> None :
132
132
if self .is_empty ():
133
133
raise Exception ("Empty Queue" )
134
134
135
- def check_is_full (self ):
135
+ def check_is_full (self ) -> None :
136
136
if self .rear .next == self .front :
137
137
raise Exception ("Full Queue" )
138
138
139
139
140
140
class Node :
141
- def __init__ (self ):
141
+ def __init__ (self ) -> None :
142
142
self .data = None
143
143
self .next = None
144
144
self .prev = None
0 commit comments