Join Simon Allardice for an in-depth discussion in this video Using queues for first-in, first-out, part of Programming Foundations: Data Structures.
The key difference between a stack and a Queue.…Stacks are last in first out LIFO.…Queues are first in first out FIFO.…Think of a line at the bank or the supermarket.…We can add multiple people to the queue.…But when we want to take something from the queue,…they should always be taken from the front of the queue.…One gets taken from the front, the others shuffle up…to the front of the queue and the process continues.…Now, queues are used a lot in programming.…Think of sending jobs to a printer.…
As the printer can only deal with one thing at a time, it has a built in queue.…You queue up multiple jobs for printing, and it will…take those jobs in the order that they were submitted.…First in will be first out.…And queues are very commonly used in multi…threading and concurrency situations to keep track of…what tasks are waiting to be performed and making sure we take them in that order.…Now just as with the stack the idea of a queue as an abstract data type…is that we do not care about the…actual implementation of this data structure behind the scenes.…
Author
Released
6/10/2014Starting with simple ways of grouping data like arrays and structs, together you'll explore gradually more complex data structures, like dictionaries, sets, hash tables, queues and stacks, links and linked lists, and trees and graphs. Simon keeps the lessons grounded in the real world and answers the "why" behind many data-structuring decisions: Why use a hash table? Why is a set useful? Why avoid arrays? When you're finished with the course, you'll have a clear understanding of data structures and understand how to use them in whatever language you're programming in, today or 5 years from now.
- What is a data structure?
- Using C-style structs and arrays
- Sorting and searching arrays
- Working with singly and doubly linked lists
- Using stacks for last-in, first-out (LIFO) structures
- Using queues for first-in, first-out (FIFO) structures
- Working with hash tables
- Understanding binary search trees (BSTs)
- Learning about graphs
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome1m 27s
-
What you should know2m 49s
-
-
1. Simple Structures and Basic Arrays
-
What is a data structure?4m 14s
-
Using C-style structs5m 57s
-
Basic arrays5m 58s
-
Multidimensional arrays6m 26s
-
-
2. Advanced Array Behavior
-
Sorting arrays3m 15s
-
Searching arrays4m 20s
-
Using binary searching4m 17s
-
3. Working with Lists
-
Introduction to lists2m 12s
-
-
4. Using Stacks and Queues
-
Priority queues and dequeues3m 35s
-
5. Hash-Based Data Structures
-
Using associative arrays5m 13s
-
Understanding hash functions4m 47s
-
Using hash tables4m 50s
-
Supporting hashing3m 22s
-
-
6. Sets, Trees, and Graphs
-
Using sets5m 28s
-
Introduction to graphs4m 47s
-
-
Conclusion
-
Review and conclusion5m 40s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Using queues for first-in, first-out