Last active
June 15, 2018 06:59
-
-
Save Sisekelo/cf8c21a57b0a5eeaced0fea143d58881 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.