| pop | R Documentation |
Remove top element in a stack or priority queue or the first element in a queue by reference.
pop(x)
x |
A CppStack, CppQueue, or CppPriorityQueue object. |
In a stack, it is the last inserted element. In a queue, it is the first inserted element. In a descending (ascending) priority queue, it is the largest (smallest) value.
Invisibly returns NULL.
back, emplace, front, push, top.
s <- cpp_stack(4:6)
s
# Top element: 6
pop(s)
s
# Top element: 5
q <- cpp_queue(4:6)
q
# First element: 4
pop(q)
q
# First element: 5
p <- cpp_priority_queue(4:6)
p
# First element: 6
pop(p)
p
# First element: 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.