queue-queue.html

来自「经典的数据结构源代码(java 实现)」· HTML 代码 · 共 42 行

HTML
42
字号
<html><head><title>Code Fragment</title></head><body text=#000000><center></center><br><br><dl><dd><pre><font color=#8000a0>public</font> <font color=#8000a0><font color=#ff8000>interface</font> </font>Queue&lt;E&gt; {   <font color=#ff0080>/**   * Returns the number of elements in the queue.  * @return number of elements in the queue.  */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>int</font> <font color=#0000ff>size</font>();   <font color=#ff0080>/**   * Returns whether the queue is empty.  * @return true if the queue is empty, false otherwise.  */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>boolean</font> <font color=#0000ff>isEmpty</font>();  <font color=#ff0080>/**  * Inspects the element at the front of the queue.  * @return element at the front of the queue.  * @exception EmptyQueueException if the queue is empty.  */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font>E <font color=#0000ff>front</font>() <font color=#8000a0><font color=#ff8000>throws</font> </font>EmptyQueueException;  <font color=#ff0080>/**   * Inserts an element at the rear of the queue.  * @param element new element to be inserted.  */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>void</font> <font color=#0000ff>enqueue </font>(E element);  <font color=#ff0080>/**   * Removes the element at the front of the queue.  * @return element removed.  * @exception EmptyQueueException if the queue is empty.  */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font>E <font color=#0000ff>dequeue</font>() <font color=#8000a0><font color=#ff8000>throws</font> </font>EmptyQueueException; }</dl></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?