Rounds are the step before BFS
transcript
An update spreads from one server. How many rounds does it take? A queue can count them.
Round one. The queue holds server zero. Zero passes it on. One and two join. Round two handles exactly two servers. Round three handles the rest.
Read the size at the start of a round. Handle exactly that many items. New items wait for the next round.
Add one to the count after the loop. One round is one whole level. Not once for each item. Counting items gives a wrong answer. Four levels need four rounds, not seven.
This loop is BFS without a visited set. BFS adds a visited set. The round number is then the distance.
Updates spread in rounds. Searches on graphs run in rounds. Retries come in waves. Each round is one level.
Read the size of the queue. Handle that many items. Full breakdown in the lecture.