Add algorithms for queues