Adding in more Algorithms and Data Structures implemented in Java
This commit is contained in:
16
src/Stack.java
Normal file
16
src/Stack.java
Normal file
@@ -0,0 +1,16 @@
|
||||
public interface Stack {
|
||||
// Add to Top
|
||||
void push(int item);
|
||||
|
||||
// Remove from the top
|
||||
int pop();
|
||||
|
||||
// Look at the first item
|
||||
int peek();
|
||||
|
||||
// How many elements
|
||||
int size();
|
||||
|
||||
// Is the stack empty
|
||||
boolean isEmpty();
|
||||
}
|
||||
Reference in New Issue
Block a user