without_front.rdeque: Return a version of an rdeque without the front element

Description Usage Arguments Details Value References See Also Examples

Description

Simply returns a version of the given rdeque without the front element. Results in an error if the structure is empty. The original rdeque is left alone.

Usage

1
2
## S3 method for class 'rdeque'
without_front(x, ...)

Arguments

x

rdeque to remove elements from.

...

additional arguments to be passed to or from methods (ignored).

Details

Runs in O(1)-amortized time if the rdeque is used non-persistently (see documentation of rdeque for details). If the given rdeque is empty, an error will be generated.

Value

version of the rdeque with the front element removed.

References

Okasaki, Chris. Purely Functional Data Structures. Cambridge University Press, 1999.

See Also

insert_front for inserting elements.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
d <- rdeque()
d <- insert_front(d, "a")
d <- insert_front(d, "b")
d <- insert_front(d, "c")

d2 <- without_front(d)
print(d2)

d3 <- without_front(d)
print(d3)

print(d)


Search within the rstackdeque package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.