CreateQueue


queue = CreateQueue({copyQueue})

This function returns an object reference that points to a queue. An existing queue may be copied by placing it as the optional parameter copyQueue.

A queue is collection of variables in which the entities in the collection are kept in First-In-First-Out order. New entries in a queue are added to the rear or enqueue. Removal of entities are taken from the front terminal position of the queue, known as dequeue. This makes the queue a First-In-First-Out (FIFO) data structure.


queue = CreateQueue()

n = 1
put queue, n ' Push

1



n = n + 1
put queue, n ' Push

2

1



n = n + 1
put queue, n ' Push

3

2

1



get queue, a ' Peek

3

2

1

a = 1


remove queue, a ' Pop

3

2

a = 1


remove queue, a ' Pop

3

a = 2


Data Structures







Become a Patron