StackL {collections} | R Documentation |
The StackL
class returns a stack with list backend.
Pure R implementation, mainly for benchmark.
StackL
An object of class R6ClassGenerator
of length 24.
StackL$new(items = NULL) StackL$push(item) StackL$pop() StackL$peek() StackL$clear() StackL$size() StackL$as_list()
items
: initialization list
item
: any R object
s <- StackL$new() s$push("first") s$push("second") s$pop() # second s$pop() # first s <- StackL$new(list("foo", "bar")) s$push("baz")$push("bla")