View source: R/length.rdeque.R
length.rdeque | R Documentation |
Returns the number of elements in an rdeque.
## S3 method for class 'rdeque' length(x)
x |
rdeque to get the length of. |
Runs in O(1) time, as this information is stored seperately and updated on every insert/remove.
a vector of length 1 with the number of elements.
empty
for checking whether an rdeque is empty.
d <- rdeque() d <- insert_front(d, "a") print(length(d)) # 1 d <- insert_back(d, "b") print(length(d)) # 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.