Implement the linked queue.