Peek Front Element of Queue
📖 Scenario: Imagine a line of customers waiting at a ticket counter. We want to see who is at the front of the line without removing them.
🎯 Goal: You will create a queue of customer IDs, then write code to peek at the front customer without removing them.
📋 What You'll Learn
Create an integer array called
queue with exactly these values: 101, 102, 103, 104, 105Create an integer variable called
front_index and set it to 0Write code to peek the front element of the queue using
queue[front_index]Print the front element using
printf with the exact format: "Front element: %d\n"💡 Why This Matters
🌍 Real World
Queues are used in real life to manage lines, like customers waiting or tasks waiting to be processed.
💼 Career
Understanding queues and how to peek at elements is important for software development, especially in areas like task scheduling and resource management.
Progress0 / 4 steps
