CIRCULAR BUFFER TRACK
CAPACITY: 5
↻ Wrap-Around Path: (Index + 1) % Capacity
FRONT -1
REAR -1
SIZE 0
CAPACITY 5
STATUS EMPTY
PHYSICAL ARRAY RAM Memory Slots [0 .. Cap-1]
LOGICAL FIFO QUEUE First In, First Out Order

💡 Circular Queue Fundamentals

A Circular Queue is an advanced linear data structure that overcomes the memory-wasting limitation of a standard linear array queue. In a regular linear queue, once the rear pointer reaches the end of the array, no new elements can be enqueued even if slots at the beginning have been vacated by dequeue operations.

↻ Circular Modulo Arithmetic
Next REAR = (REAR + 1) % Capacity Next FRONT = (FRONT + 1) % Capacity

Key Mathematical Conditions

  • Initial State: FRONT = -1, REAR = -1, SIZE = 0
  • Empty Check (Underflow): SIZE == 0 (or FRONT == -1)
  • Full Check (Overflow): SIZE == Capacity or (REAR + 1) % Capacity == FRONT
  • Single Element Dequeue: When the last remaining element is dequeued, reset FRONT = -1, REAR = -1.

Physical Array vs. Logical FIFO Order

In memory, array indices are fixed from 0 to Capacity - 1. However, because of the circular wrap-around, the logical front of the queue may sit at a higher index than the logical rear!

Physical Indices: [0]   [1]   [2]   [3]   [4]
Array Contents: [60]   [70]   [30]   [40]   [50]
Pointers:         ↑ REAR=1      ↑ FRONT=2
Logical Queue: 30 → 40 → 50 → 60 → 70

📜 Operation History

Stored in Database
Time Action Value Front Rear Size Wrap?
Loading history...

Circular Queue Visualizer

Mobile-First Academic Data Structures Project — 2026

👥 Project Development Team

BP Babish P K
BS Bersha S K
AL Alisha
JH Jharna

⚙ Technical Architecture

  • Backend Engine: Python 3 + Flask REST API
  • In-Memory Core: Object-Oriented CircularQueue (Modulo Math)
  • Database Layer: SQLite (Default zero-config) + Optional MySQL (Port 3307)
  • Frontend: Mobile-First Vanilla CSS3 + Modern ES6+ JavaScript
  • PWA: Installable Web App, Offline Static Cache Service Worker

📱 Local Wi-Fi Access for Mobile Testing

To run this application directly on your phone:

  1. Connect your mobile phone to the same Wi-Fi network as your computer.
  2. Open Command Prompt / PowerShell on your PC and run: ipconfig
  3. Find your IPv4 Address (e.g. 192.168.1.50).
  4. On your phone browser, open: http://<YOUR-IP>:5000

Circular Queue Visualizer

Academic Data Structures Project — 2026