Skip to content

Commit 10cb225

Browse files
authored
Merge pull request #583 from leios/tree_traversal_typo
adding l to ideal in tree traversal
2 parents 978f426 + 18c91e7 commit 10cb225

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contents/tree_traversal/tree_traversal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ In code, it looks like this:
224224
[import:64-79, lang:"emojicode"](code/emojicode/tree_traversal.emojic)
225225
{% endmethod %}
226226

227-
All this said, there are a few details about DFS that might not be idea, depending on the situation. For example, if we use DFS on an incredibly long tree, we will spend a lot of time going further and further down a single branch without searching the rest of the data structure. In addition, it is not the natural way humans would order a tree if asked to number all the nodes from top to bottom. I would argue a more natural traversal order would look something like this:
227+
All this said, there are a few details about DFS that might not be ideal, depending on the situation. For example, if we use DFS on an incredibly long tree, we will spend a lot of time going further and further down a single branch without searching the rest of the data structure. In addition, it is not the natural way humans would order a tree if asked to number all the nodes from top to bottom. I would argue a more natural traversal order would look something like this:
228228

229229
<p>
230230
<img class="center" src="res/BFS_simple.png" width="500" />

0 commit comments

Comments
 (0)