队列

特性

FIFO : First In First Out

抽象数据结构

  • Enqueue: Add an element to the end of the queue
  • Dequeue: Remove an element from the front of the queue
  • IsEmpty: Check if the queue is empty
  • IsFull: Check if the queue is full
  • Peek: Get the value of the front of the queue without removing it

应用场景

  • CPU scheduling, Disk Scheduling
  • When data is transferred asynchronously between two processes.Queue is used for synchronization. eg: IO Buffers, pipes, file IO, etc
  • Handling of interrupts in real-time systems.
  • Call Center phone systems uses Queues to hold people calling them in an order

以下是常见的队列

简单队列 · 环形队列 · 优先队列 · 双端队列

powered by Gitbook© 2023 编外计划 | 最后修改: 2023-11-24 03:37:00

results matching ""

    No results matching ""