Description Usage Arguments Details Value Examples
Returns the first n elements of a deque as a deque, or all of the elements if its length is less than n.
1 2 |
x |
rdeque to get the head of. |
n |
number of elements to get. |
... |
arguments to be passed to or from other methods (ignored). |
Runs in O(n) time (in the size of the number of elements requested).
a new rdeque.
1 2 3 4 5 6 7 | d <- rdeque()
d <- insert_back(d, "a")
d <- insert_back(d, "b")
d <- insert_back(d, "c")
dt <- head(d, n = 2)
print(dt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.