types/collections/stack.ql
Function | Description |
---|---|
static fun fromList(list) | Creates a new stack from a list of elements. |
fun push(element) | Pushes an element onto the stack. |
fun pop() | Pops an element from the stack. |
fun peek() | Peeks at the top element of the stack. |
fun isEmpty() | Checks if the stack is empty. |
fun size() | Gets the size of the stack. |
fun toList() | Converts the stack to a list. |
Field | Description |
---|---|
any _stack |
Pushes an element onto the stack.
element
|
The element to push onto the stack |
Pops an element from the stack.
The element popped from the stack
If the stack is empty
Peeks at the top element of the stack.
The top element of the stack
If the stack is empty