combine: combine

View source: R/combine.r

combineR Documentation

combine

Description

Combine two objects (queue/stack/deque) into one of the same type.

Usage

combine(x1, x2)

Arguments

x1, x2

Two different deques, stacks, or queues. Arguments must be of the same type.

Details

Operates via side-effects; see examples for clarification on usage.

Value

Returns NULL. After combining, object x2 is a 0-length (empty) object.

Examples

## 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

## End(Not run)


wrathematics/dequer documentation built on March 17, 2022, 6:38 p.m.