BAPC training week 5: queues and BFS