Round-Robin Scheduler - Circular Queue

Visualize fixed-size circular queue with wrap-around behavior!

🎯 Problem: Circular Queue for Round-Robin

Hi! I'm Teju 👋 We're implementing a **fixed-size circular queue** for round-robin scheduling.

When the queue is full, new tasks are rejected ("Queue Full").

Operations:
ENQUEUE x → Add task x (reject if full)
DEQUEUE → Remove & return front task
FRONT → Peek at front task
ISEMPTY → Check if queue is empty

Special messages:
Queue Full → when trying to enqueue on full queue
Queue Empty → when dequeue/front on empty queue

⚙️ Circular Queue (Array + Wrap-around)

We use a fixed-size array with two pointers: front and rear.

When rear reaches the end → it wraps around to 0 (circular behavior).

  • ENQUEUE x: Add at (rear+1) % size, if not full
  • DEQUEUE: Remove from front, move front forward
  • FRONT: Return value at front (or "Queue Empty")
  • ISEMPTY: front == -1 (or size == 0)

🎮 Interactive Demo

📜 Operation Log

Enter capacity & commands, then click Run Simulation...

📤 Output

Program output will appear here...

Circular Queue Visualization (Round-Robin)

Queue is Empty