without_front.rpqueue {rstackdeque} | R Documentation |
Simply returns a version of the given rpqueue without the front element. Results in an error if the structure is empty. The original rpqueue is left alone.
## S3 method for class 'rpqueue' without_front(x, ...)
x |
rpqueue to remove elements from. |
... |
additional arguments to be passed to or from methods (ignored). |
Runs in O(1) worst case time.
version of the rpqueue with the front element removed.
Okasaki, Chris. Purely Functional Data Structures. Cambridge University Press, 1999.
peek_front
for accessing the front element.
q <- rpqueue() q <- insert_back(q, "a") q <- insert_back(q, "b") q <- insert_back(q, "c") q2 <- without_front(q) print(q2) q3 <- without_front(q) print(q3) print(q)