Skip to content

Instantly share code, notes, and snippets.

View jordancodurance's full-sized avatar

Jordan Colgan jordancodurance

View GitHub Profile
@jordancodurance
jordancodurance / Stack.java
Created January 3, 2023 11:37
Special case null stack solution for https://www.codurance.com/katalyst/stack
interface Stack {
static Stack create(int size) {
if (size < 0) throw new IllegalStackSizeException();
if (size == 0) return new NullStack();
return new BoundedStack(size);
}
void push(int element);
boolean isEmpty();
// Other operations...