Skip to content

format

typescript
Queue.Swap(rhs)

class: Queue

description

Swaps the elements in the current queue with the elements in the specified queue.

parameter

param_nametypedescription
rhsQueue<T>The specified queue.

reture

typedescription
void

code example

typescript
let queue = new Queue<Number>();
for (let index = 0; index < 3; index++) {
    queue.Enqueue(index);
}
let other = new Queue<Number>();
other.Enqueue(100);

queue.Swap(other);