Skip to content

Instantly share code, notes, and snippets.

@Sisekelo
Last active June 15, 2018 06:59
Show Gist options
  • Select an option

  • Save Sisekelo/cf8c21a57b0a5eeaced0fea143d58881 to your computer and use it in GitHub Desktop.

Select an option

Save Sisekelo/cf8c21a57b0a5eeaced0fea143d58881 to your computer and use it in GitHub Desktop.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Queue;
/**
*
* @author Sisekelo
* @param <T>
*/
public interface QueueInterface <T> {
//adds object to the queue, doesnt return anything
void enqueue(T t);
//removes head of queue
T dequeue();
//checks what object is on top of queue
T peek();
//checks if queue is empty, returns boolean
boolean empty();
}
@stephennaicken
Copy link

This interface looks fine and I see progress with the naming convention - before I saw code where the interface name started with a lower case letter. Good.

Try to give the implementation a go, feel free to read the other gists to get an idea as to what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment