Update README.md

This commit is contained in:
marina 2023-08-01 14:51:34 -07:00 committed by GitHub
parent fb971d112c
commit eb45cdd938
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,8 +20,7 @@
<br> <br>
- iterative solutions use a queu (level order problem) - iterative solutions use a queue for traversal or find the shortest path from the root node to the target node (level order problem)
- one common application of breadth-first search (BFS) is to find the shortest path from the root node to the target node.
- in the first round, we process the root node, in the second round, we process the nodes next to the root node, in the third round, we process the nodes which are two steps from the root node, etc. newly-added nodes will not be traversed immediately but will be processed in the next round. - in the first round, we process the root node, in the second round, we process the nodes next to the root node, in the third round, we process the nodes which are two steps from the root node, etc. newly-added nodes will not be traversed immediately but will be processed in the next round.
- if node X is added to the kth round queue, the shortest path between the root node and X is exactly k. - if node X is added to the kth round queue, the shortest path between the root node and X is exactly k.
- the processing order of the nodes in the exact same order as how they were added to the queue, which is FIFO. - the processing order of the nodes in the exact same order as how they were added to the queue, which is FIFO.