DequeL {collections}R Documentation

Double Ended Queue (list based)

Description

The DequeL class creates a double ended queue with list backend. Pure R implementation, mainly for benchmark.

Usage

DequeL

Format

An object of class R6ClassGenerator of length 24.

Usage

DequeL$new(items = NULL)
DequeL$push(item)
DequeL$pushleft(item)
DequeL$pop()
DequeL$popleft()
DequeL$peek()
DequeL$peekleft()
DequeL$extend(q)
DequeL$extendleft(q)
DequeL$clear()
DequeL$remove(item)
DequeL$size()
DequeL$as_list()

Arguments

See Also

Deque

Examples

q <- DequeL$new()
q$push("foo")
q$push("bar")
q$pushleft("baz")
q$pop()  # bar
q$popleft()  # baz

q <- DequeL$new(list("foo", "bar"))
q$push("baz")$pushleft("bla")

[Package collections version 0.1.6 Index]