Queue Implementations - Java Pt. 4

Chris Chen
/*
* Purpose: to create an interface with the group of Queue methods
*/

public interface Queue{

public boolean isEmpty(); //checks if the queue is empty
public boolean add(Object o); //places an object at the end of the queue
public Object peek(); //returns the value at the front of the queue
public Object remove(); //removes and returns the value at the front of the queue

}//end Queue interface

You will also need a Listnode.java class which can be found by following the link below.
http://www.associatedcontent.com/article/2636363/linked_list_implementation_java_pt.html?cat=15

Published by Chris Chen

Chris is currently attending the University of California, Berkeley seeking an undergraduate's degree in Electrical Engineering Computer Science. He enjoys playing basketball, practicing kendo, hanging out w...  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.