stack Of
Creates a new Stack instance wrapping the given values.
The first of the given items will be the top of the stack, and the last of the given items will be the bottom.
Example:
val stack = stackOf(1, 2, 3)
stack.pop() // 1
stack.pop() // 2
stack.pop() // 3
Content copied to clipboard
Return
A new Stack
instance.
Author
Elizabeth Paige Harper - https://github.com/foxcapades
Since
0.1.0
Parameters
items
Items that will back the newly created stack.
Creates a new Stack instance wrapping the values provided by the given iterable.
The first item provided by the items iterable will be the top of the stack, and the last item provided by the iterable will be the bottom.
Example:
val items = listOf(1, 2, 3)
val stack = stackOf(items)
stack.pop() // 1
stack.pop() // 2
stack.pop() // 3
Content copied to clipboard
Return
A new Stack
instance.
Author
Elizabeth Paige Harper - https://github.com/foxcapades
Since
0.1.0
Parameters
items
Items that will back the newly created stack.