A Disney queue is a parodical and esoteric data structure. It is a variant upon the queue that supports a FastPass line, a Single Rider line, as well as other features of queues at Disney (any user who knows of a feature of queues at Disney parks that is not mentioned here is free to add it).
This operation enqueues a group into the main line. It accepts a list of items that it puts at the end of the line. These members are kept associated for the dequeueing process.
Enqueue with FastPass®
Enqueues associated group [group members] into the FastPass line after a time limit. Only a certain number of these can be done every hour.
Enqueue Single Rider
This operation adds one unassociated rider to the Single Rider Line.
The dequeuing operation is rather complicated. Here, we will discuss a simplification of it. N is equal to an integer indicating the length of the array to output to from the function. The way that this works is: Groups are added from the FastPass and Main lines in alternating sequence until there isn't room for the next group in line. Then, if any are available in the Single Rider line, N is met by adding single members of the SRL until the quota is met. If there are not enough Single Riders to meet n, then the array is returned with nulls in place of the riders that could not be met.
At Disney, a child swap occurs when two parents and a child reach the front of the line for a ride that the child does not meet the requirements to ride. Parent A rides while Parent B stays behind with the child at the front of the line, then when Parent A reaches the end, Parent B rides while Parent A stays with the child.
In Disney queues, to emulate a child swap, this process is followed: if an item which does not meet the requirements to ride set upon queue creation is entered into the queue, a "child swap" may occur when that group reaches the front of the line. All but one member of the group (excluding all objects unable to be dequeued) are dequeued, then the one remaining member is dequeued and the child is dropped from the queue. This roughly emulates an actual "Child Swap" at Disney parks.