← All Topics

Queues — Simple English

26 lessons · Data Structures & Algorithms · Simple English · Beginner Friendly

🔒Premium course. The first 3 lessons are free — subscribe to unlock the rest (one plan unlocks every premium course).View plans
01 Understanding the Problem: Why We Need FIFOFree Understanding the Problem: Why We Need FIFO Before we learn a new data structure, it helps to first understand the kind … 02 The Queue: A Data Structure That Works in FIFO OrderFree The Queue: First In, First Out Some problems can only be solved correctly when we handle items in the exact order they a… 03 Key Properties of a Queue: Capacity, Size, Front, and BackFree Key Properties of a Queue Now that you know what a queue is and why it is useful, let's look at the parts that describe … 04 Queue Operations: Enqueue, Dequeue, Size, Front, and Back🔒 What You Can Do With a Queue A queue is like a line of people waiting at a ticket counter. The person who joins first is… 05 How to Build a Queue Using an Array🔒 How to Build a Queue Using an Array A queue is a simple line of data items. Just like people standing in line at a shop,… 06 The Cyclic Nature of Array-Based Queues🔒 The Cyclic Nature of Array-Based Queues A queue is a line of data, just like a line of people waiting at a ticket counte… 07 Building a Queue as a Class Using an Array🔒 Building a Queue as a Class Using an Array When we build a queue on top of a plain array, the array alone is not enough.… 08 Finding the Size of a Queue🔒 How Many Items Are in the Queue? A queue is a line of items where new items join at the back and items leave from the fr… 09 Checking if a Queue is Empty🔒 Checking if a Queue is Empty Sometimes, before you do anything with a queue, you need to ask a simple question: "Is ther… 10 The front Operation: Reading the First Item in a Queue🔒 The front Operation in a Queue A queue works like a line of people waiting at a counter. The person who arrived first st… 11 The `back` Operation: Reading the Last Element of a Queue🔒 The back Operation in a Queue A queue is like a line of people waiting at a counter. People join at the back of the line… 12 Enqueue: Adding an Item to a Queue🔒 Enqueue: Adding an Item to a Queue A queue is like a line of people waiting for a ticket. New people join at the back of… 13 Removing an Item from a Queue: The Dequeue Operation🔒 Removing an Item from a Queue: The Dequeue Operation A queue works like a line of people waiting for their turn. People … 14 Building a Queue Using a Circular Array🔒 Building a Queue Using a Circular Array A queue is a simple line, just like people waiting at a ticket counter. The firs… 15 Building a Queue with a Linked List🔒 Building a Queue with a Linked List A queue is a simple, orderly line of data. You can only do two things with it: - enq… 16 Building a Queue Class with a Linked List🔒 Building a Queue Class with a Linked List A queue is a waiting line. New items join at the back, and items leave from th… 17 Finding the Size of a Queue (Linked List Version)🔒 Finding the Size of a Queue Sometimes you just want to know one simple thing about a queue: how many items are in it rig… 18 Checking if a Linked-List Queue is Empty🔒 Checking if a Queue is Empty A queue is a line of items, just like people waiting in line at a shop. Sometimes, before w… 19 Looking at the Front of a Queue🔒 Looking at the Front of a Queue A queue works like a line of people waiting at a shop. People join at the back, and the … 20 Looking at the Back of a Queue🔒 Looking at the Back of a Queue A queue is a line of items where new things join at one end and old things leave from the… 21 Enqueue: Adding an Item to a Queue (Linked List Version)🔒 Enqueue: Adding an Item to a Queue A queue is a line, just like the line at a shop counter. New people join at the back,… 22 Dequeue: Removing an Item from the Front of a Queue🔒 Dequeue: Removing an Item from the Front of a Queue A queue works like a line of people waiting at a shop. The person wh… 23 Building a Queue Using a Linked List🔒 Building a Queue Using a Linked List A queue is a simple idea you already know from daily life. Think of people standing… 24 Building a Queue: What Each Operation Must Do🔒 Building a Queue, One Operation at a Time A queue is a simple idea you already know from real life. Think of people stan… 25 Building a Stack: The Six Operations You Must Implement🔒 Building a Stack: The Six Operations You Must Implement A stack is one of the simplest and most useful ways to store dat… 26 Designing a Stack Using a Single Queue🔒 Designing a Stack Using a Single Queue In this lesson we build our own stack. A stack is a simple way to store items whe…