Description Usage Details Value References See Also Examples
Creates a new, empty, rpqueue ready for use.
1 | rpqueue()
|
An rpqueue provides "First In, First Out" (FIFO) access; envisaged
as a queue, elements may be inserted at the back and removed from the front. Unlike
rdeque
, access is gauranteed O(1) worst case even when used
persistently, though in most situations rdeques will be faster in practice
(see the documentation for rdeque
for details).
Other handy functions
include as.list
and as.data.frame
(the latter of which requires that
all elements can be appended to become rows of a data frame in a reasonable manner).
a new rpqueue.
Okasaki, Chris. Purely Functional Data Structures. Cambridge University Press, 1999.
rstack
for a fast LIFO-only structure.
1 2 3 4 5 6 7 8 9 10 11 | q <- rpqueue()
q <- insert_back(q, "a")
q <- insert_back(q, "b")
print(q)
q2 <- without_front(q)
print(q2)
print(q)
b <- peek_front(q)
print(b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.