Queue Implementation Using Array
📖 Scenario: You are helping a small bakery manage the queue of customers waiting to place their orders. The bakery wants to keep track of customers in the order they arrive and serve them one by one.
🎯 Goal: Build a simple queue using a Python list (array) to add customers to the end and remove them from the front, simulating the real-life queue at the bakery.
📋 What You'll Learn
Create an empty list called
queue to hold customer names.Create a variable called
max_size to limit the queue size to 5.Write code to add a customer named
'Alice' to the queue if there is space.Write code to remove the first customer from the
queue to simulate serving them.Print the final state of the
queue.💡 Why This Matters
🌍 Real World
Queues are used in many places like customer service lines, printer job management, and task scheduling.
💼 Career
Understanding queues helps in software development roles that involve managing tasks, requests, or data streams in order.
Progress0 / 4 steps