peek_front | R Documentation |
Simply returns the data element sitting at the front of the deque, leaving the deque alone.
peek_front(x, ...)
x |
rdeque to look at. |
... |
additional arguments to be passed to or from methods (ignored). |
Runs in O(1) worst-case time.
data element at the front of the rdeque.
d <- rdeque() d <- insert_front(d, "a") d <- insert_back(d, "b") e <- peek_front(d) print(e) print(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.