⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queue.java

📁 BOOK:Beginning Algorithms Code Examples
💻 JAVA
字号:
package com.wrox.algorithms.queues;/** * A generic interface for queues. * */public interface Queue {    /**     * Stores a value in the queue. The size of the queue will increase by one.     *     * @param value The value to add.     */    public void enqueue(Object value);    /**     * Retrieves the value at the head of the queue. The size of the queue will decrease by one.     *     * @return The value at the head of the queue.     * @throws EmptyQueueException If the queue is empty (<code>isEmpty() == true</code>).     */    public Object dequeue() throws EmptyQueueException;    /**     * Deletes all elements from the queue. The size of the queue will be reset to zero (0).     */    public void clear();    /**     * Obtains the number of elements in the queue.     *     * @return The number of elements in the queue.     */    public int size();    /**     * Determines if the queue is empty or not.     *     * @return <code>true</code> if the queue is empty (<code>size() == 0</code>); otherwise returns <code>false</code>.     */    public boolean isEmpty();}

⌨️ 快捷键说明

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