peek_front {rstackdeque} | 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)