Description Usage Arguments Details Value References Examples
Returns a version of the deque/queue with the new element in the back position.
1 | insert_back(x, e, ...)
|
x |
rdeque or rpqueue to insert onto. |
e |
element to insert. |
... |
additional arguments to be passed to or from methods (ignored). |
Runs in O(1) time worst-case. Does not modify the original.
modified version of the rdeque or rpqueue.
Okasaki, Chris. Purely Functional Data Structures. Cambridge University Press, 1999.
1 2 3 4 5 6 7 8 | d <- rdeque()
d <- insert_back(d, "a")
d <- insert_back(d, "b")
print(d)
d2 <- insert_back(d, "c")
print(d2)
print(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.