Basic queues, list and algorithm