Package org.hololink.collection
Class LinkedListStack
- java.lang.Object
-
- org.hololink.collection.LinkedListStack
-
public class LinkedListStack extends java.lang.ObjectAn implementation of a stack as a sequence of nodes.
-
-
Constructor Summary
Constructors Constructor Description LinkedListStack()Constructs an empty stack.
-
-
-
Method Detail
-
push
public void push(java.lang.Object element)
Adds an element to the top of the stack.- Parameters:
element- the element to add
-
pop
public java.lang.Object pop()
Removes the element from the top of the stack.- Returns:
- the removed element
-
empty
public boolean empty()
Checks whether this stack is empty.- Returns:
- true if the stack is empty
-
-