Stack
Generic Stack
A simple stack implementation.
Example:
// Create a new stack
val stack = Stack<Int>()
// Push 3, 2, then 1 onto the stack.
for (i in 3 downTo 1)
stack.push(i)
// Pop 1, 2, then 3 from the stack.
for (i in 1 .. 3)
require(stack.pop() == i)
Content copied to clipboard
Author
Elizabeth Paige Harper - https://github.com/foxcapades
Since
0.1.0
Parameters
T
Type of items that will be pushed onto this stack.
Constructors
Functions
Link copied to clipboard
Returns true
if this stack contains all the given elements.
Link copied to clipboard
Returns true
if this stack contains one or more items.