MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

data_structures/queues/circular_queue.py:7–12  ·  view source on GitHub ↗
(self, n: int)

Source from the content-addressed store, hash-verified

5 """Circular FIFO queue with a fixed capacity"""
6
7 def __init__(self, n: int):
8 self.n = n
9 self.array = [None] * self.n
10 self.front = 0 # index of the first element
11 self.rear = 0
12 self.size = 0
13
14 def __len__(self) -> int:
15 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected