Learn R Programming

collections (version 0.1.0)

QueueL: Queue (list based)

Description

The QueueL class creates a queue with list backend. It is recommended for short queue.

Usage

QueueL

Format

An object of class R6ClassGenerator of length 24.

Usage

QueueL$new()
QueueL$push(item)
QueueL$pop()
QueueL$size()
QueueL$as_list()

Argument

  • item: any R object

See Also

Queue

Examples

Run this code
# NOT RUN {
q <- QueueL$new()
q$push("first")
q$push("second")
q$pop()  # first
q$pop()  # second
# }

Run the code above in your browser using DataLab