课程: Java Algorithms
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
What is a queue?
- [Instructor] The queue is another data structure that can be particularly useful in algorithms where you need to process data in order. Like an array or list, a queue represents a series of objects, but the way we access, add and remove items is slightly different. A queue contains the elements in the order they were added. It's designed to have elements inserted at the end of the queue and elements removed from the beginning of the queue. You cannot remove items from the middle or end. You must remove from the front. Similarly, you cannot add items to the middle or front. You must add to the back. For this reason, we say queues follow a FIFO, or first in, first out policy. The first item in the queue must be the first item out of the queue. Now when we talk about adding and removing items, we refer to it as enqueueing and dequeueing. When we add an item, we enqueue it to the back of the queue. When we remove an item, we dequeue it from the front of the queue. We cannot add an…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
What is a queue?1 分钟 53 秒
-
(已锁定)
Standard queue operations in Java3 分钟 38 秒
-
(已锁定)
Queue algorithms: Generate binary numbers4 分钟 41 秒
-
(已锁定)
What is a stack?1 分钟 58 秒
-
(已锁定)
Basic stack operations in Java3 分钟 32 秒
-
(已锁定)
Stack algorithms: Theorizing an algorithm5 分钟 21 秒
-
(已锁定)
Stack algorithms: Next greater element3 分钟 57 秒
-
(已锁定)
Stack algorithms: Matching parentheses4 分钟 49 秒
-
(已锁定)
Solution: Evaluate reverse polish notation4 分钟 16 秒
-
(已锁定)
-
-
-