diff options
| author | root <root@turin.home> | 2022-01-16 13:42:19 +0000 |
|---|---|---|
| committer | root <root@turin.home> | 2022-01-16 13:42:19 +0000 |
| commit | d7d89d19c2e795cbeb1f1b9136a9118aeacfb720 (patch) | |
| tree | ad671634b4c1f74198630ad785d651acc8c9a811 | |
| parent | 2ee793179e345f3355462c8d2753543bc397a2aa (diff) | |
Fix queue size error
| -rw-r--r-- | circular_queue.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/circular_queue.py b/circular_queue.py index 424d1e5..44954bd 100644 --- a/circular_queue.py +++ b/circular_queue.py @@ -9,7 +9,7 @@ class circular_queue: def add(self, value): self.queue[self.pointer] = value self.pointer += 1 - if self.pointer > 49: + if self.pointer >= self.size: self.pointer = 0 def average(self): |
