powered by
Combine two objects (queue/stack/deque) into one of the same type.
combine(x1, x2)
Two different deques, stacks, or queues. Arguments must be of the same type.
Returns NULL. After combining, object x2 is a 0-length (empty) object.
NULL
x2
Operates via side-effects; see examples for clarification on usage.
# NOT RUN { library(dequer) s1 <- stack() for (i in 1:5) push(s1, i) s2 <- stack() for (i in 10:8) push(s2, i) combine(s1, s2) s1 # now holds all 8 elements s2 # holds 0 elements # } # NOT RUN { # }
Run the code above in your browser using DataLab