queue: Queue

Description Usage Arguments Details Value

Description

Queue is an abstract data type which allows for pushing elements and popping them in normal (first in-first out) order.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## S3 method for class 'Queue'
as.list(queue)

queue_create()

queue_empty(queue)

queue_push(queue, obj)

queue_pop(queue)

## S3 method for class 'Queue'
print(queue, ...)

## S3 method for class 'Queue'
format(queue, ...)

## S3 method for class 'Queue'
str(queue, ...)

Arguments

queue

a queue object

obj

an R object

...

other arguments passed to or from other methods

Details

as.list.Queue converts a given queue object to an R list.

queue_create creates a new queue.

queue_empty determines if a given queue is empty or not.

queue_push pushes a given object to the back of the queue.

queue_pop pops an object from the top of the queue.

print.Queue prints the contents of the queue (coerced to a list object) on the console.

format.Queue pretty-prints the contents of the queue (coerced to a list object) on the console.

str.Queue compactly displays the contents of the queue (coerced to a list object) on the console.

Value

as.list.Queue returns an R list object.

queue_create returns a new, empty queue.

queue_empty returns a single logical value.

queue_push does not return anything interesting.

queue_pop returns an object at the top of te queue or throws an error if the stack is empty.

print.Queue returns the queue coerced to a list, invisibly.

format.Queue returns the character representation of the objects in the queue

str.Queue does not return anything interesting.


Rexamine/DataStructures documentation built on May 9, 2019, 10 a.m.