| push | R Documentation |
Add elements to the top of a stack, to the back of a queue, or to a priority queue by reference.
push(x, values)
x |
A CppStack, CppQueue, or CppPriorityQueue object. |
values |
Values to add to |
The method iterates through values starting at the front of the vector. I.e., the last element of values is added last.
Invisibly returns NULL.
back, emplace, front, pop, push, top.
s <- cpp_stack(1:4)
s
# Top element: 4
push(s, 8:9)
s
# Top element: 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.