Function stack::toarray()

← Back to Class stack



Module adtClass stack → toarray()

Description

Create an array containing all of the elements in the Stack

stack::toarray()


Parameters

There are no parameters.


Return Value


Usage Example

import adt/stack
 
stack = stack()
 
stack.push(10)
stack.push(12)
stack.push(8)
 
stack.toarray()   ' Returns [8, 12, 10]