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 b69bfca commit f9971afCopy full SHA for f9971af
data_structures/queues/circular_queue.py
@@ -1,4 +1,6 @@
1
# Implementation of Circular Queue (using Python lists)
2
+
3
4
class CircularQueue:
5
"""Circular FIFO queue with a fixed capacity"""
6
@@ -99,6 +101,7 @@ def dequeue(self):
99
101
"""
100
102
if self.size == 0:
103
raise Exception("UNDERFLOW")
104
105
temp = self.array[self.front]
106
self.array[self.front] = None
107
self.front = (self.front + 1) % self.n
0 commit comments