🏦 Bank Token System - Queue using Array

Visualize how customers are served in FIFO order using a queue!

🎯 Problem: Bank Token System

Hi! I'm Teju 👋 We're building a bank token queue system.

Customers get a token number and are served in First-In-First-Out (FIFO) order.

Operations:
ENQUEUE x → New customer with token x joins the queue
DEQUEUE → Serve (remove) the next customer
FRONT → See the next customer to be served
ISEMPTY → Check if no customers are waiting

On empty queue: DEQUEUE and FRONT should print "Queue Empty"

⚙️ Queue using Array

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

New customers are added at the rear (ENQUEUE), and served from the front (DEQUEUE).

  • ENQUEUE x: Add x at rear, increment rear
  • DEQUEUE: Remove and return element at front, increment front
  • FRONT: Return element at front (or "Queue Empty")
  • ISEMPTY: Check if front > rear

🎮 Interactive Demo

📜 Operation Log

Enter commands and click Run Simulation...

📤 Output (as in problem)

Program output will appear here...

🏦 Waiting Queue (Array Visualization)

Empty Queue — No Customers Waiting