| top | R Documentation |
Access the top element in a container without removing it.
top(x)
x |
A CppStack or CppPriorityQueue object. |
Returns the top element.
emplace, pop, push.
s <- cpp_stack(1:4)
s
# Top element: 4
top(s)
# [1] 4
s
# Top element: 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.