In the simplist dynamic memory implementation of a queue, the data
part of the linked list record is a simple type (integer, real,
booean, etc). As an example, in the type below the data
part of the linked list record node is an integer. There are two queue
pointers to the list : front points to the first node, and
rear to the last node on the linked list.

Again, front points to the first node on the linked list, and
rear, to the last node. Assume in the following that var
q : queue. In both cases, q.front := nil (and
q.rear := nil) initializes the queue; Append(q, x)
adds a node whose data part has the value x to the
end of the queue; and Remove(q, x) removes the first node
from the list. The type of x, of course, varies with the type
definition. In the former case, its integer; in the latter,
NodePtr.