获取队列当前大小 — Get current queue size
队列中元素的数量 / number of elements in the queue
队列迭代器 — Queue iterator
使队列可迭代,允许使用 for...of 循环遍历队列元素(不移除元素)。 Makes the queue iterable, allowing traversal of queue elements using for...of loop (without removing elements).
出队操作 — Dequeue operation
移除并返回队列的第一个元素(队首)。 Removes and returns the first element (front) of the queue.
队列的第一个元素,如果队列为空则返回 undefined / the first element of the queue, or undefined if the queue is empty
排空队列生成器 — Drain queue generator
一个生成器函数,逐步出队所有元素。 A generator function that gradually dequeues all elements.
查看队首元素 — Peek at front element
返回队列的第一个元素但不移除它。 Returns the first element of the queue without removing it.
队列的第一个元素,如果队列为空则返回 undefined / the first element of the queue, or undefined if the queue is empty
队列数据结构 — Queue data structure
基于单向链表的队列实现,支持先进先出(FIFO)操作。 Queue implementation based on singly linked list, supporting first-in-first-out (FIFO) operations.