Learn R Programming

collections (version 0.1.0)

Queue: Queue

Description

The Queue class creates a queue with pairlist backend. It is recommended for long queue.

Usage

Queue

Format

An object of class R6ClassGenerator of length 24.

Usage

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

Argument

  • item: any R object

See Also

QueueL

Examples

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

Run the code above in your browser using DataLab