From the course: Data Structures in JavaScript: BSTs, Queues, and Stacks

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

How to construct queues

How to construct queues

- [Instructor] This is a marathon indeed. When you chose this course, you were already a winner as a lifelong learner. Right here, right now, you are well on your way to achieving your study goals as you have successfully completed the challenge and the chapter on BSTs. That alone deserves a medal, no joke. In this module, you'll cover what queues are and how to construct one using arrays. Remember, in Chapter 1, we covered how queues are like and different from other familiar data structures. So, with this knowledge and understanding, why not jump right in and start constructing a queue? For review, a queue is a linear data structure that uses first-in, first-out, FIFO principle. When creating or updating the queue, there are two very foundational operations that will add elements at the end of the queue, known as enqueuing, and then remove and delete elements from the beginning of the queue, known as dequeuing, hence, FIFO, first element in is the first element out. Here is the code…

Contents