All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aima.core.util.datastructure.Queue Maven / Gradle / Ivy

Go to download

AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.

There is a newer version: 3.0.0
Show newest version
package aima.core.util.datastructure;

/**
 * Artificial Intelligence A Modern Approach (3rd Edition): pg 79.
*
* The operations on a queue are as follows:
*
    *
  • EMPTY?(queue) returns true only if there are no elements in the queue
  • *
  • POP(queue) removes the first element of the queue and returns it.
  • *
  • INSERT(element, queue) inserts an element and returns the resulting * queue.
  • *
* Note: This extends the java.util.Queue collections interface in order to take * advantage of pre-existing implementations. The intent of this interface is * purely to provide an interface to Queues that corresponds to what is * described in AIMA3e. * * @author Ravi Mohan * @author Ciaran O'Reilly * */ public interface Queue extends java.util.Queue { /** * EMPTY?(queue) * * @return true only if there are no elements on the queue. */ boolean isEmpty(); /** * POP(queue) * * @return the first element of the queue. */ E pop(); /** * INSERT(element, queue) * * @param element * to be inserted in the queue. * @return the resulting queue with the element inserted. null is returned * if the element could not be inserted. */ Queue insert(E element); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy