Skip to content

Commit f9971af

Browse files
Update circular_queue.py
1 parent b69bfca commit f9971af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

data_structures/queues/circular_queue.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Implementation of Circular Queue (using Python lists)
2+
3+
24
class CircularQueue:
35
"""Circular FIFO queue with a fixed capacity"""
46

@@ -99,6 +101,7 @@ def dequeue(self):
99101
"""
100102
if self.size == 0:
101103
raise Exception("UNDERFLOW")
104+
102105
temp = self.array[self.front]
103106
self.array[self.front] = None
104107
self.front = (self.front + 1) % self.n

0 commit comments

Comments
 (0)