From eb45cdd938a7734b51dff6b6b6cd1f31c4e59341 Mon Sep 17 00:00:00 2001 From: marina <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Tue, 1 Aug 2023 14:51:34 -0700 Subject: [PATCH] Update README.md --- trees/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/trees/README.md b/trees/README.md index b43c543..a62cc09 100644 --- a/trees/README.md +++ b/trees/README.md @@ -20,11 +20,10 @@
-- iterative solutions use a queu (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. -- 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. +- iterative solutions use a queue for traversal or find the shortest path from the root node to the target node (level order problem) + - 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. + - the processing order of the nodes in the exact same order as how they were added to the queue, which is FIFO.