Skip to content

Commit 336ef50

Browse files
committed
add scala to .md
1 parent f06d530 commit 336ef50

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

contents/tree_traversal/tree_traversal.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Because of this, the most straightforward way to traverse the tree might be recu
9292
{% sample lang="coco" %}
9393
[import:5-9, lang:"coconut"](code/coconut/tree_traversal.coco)
9494
{% sample lang="scala" %}
95-
[import:26-33, lang:"scala"](code/scala/tree.scala)
95+
[import:26-34, lang:"scala"](code/scala/tree.scala)
9696
{% endmethod %}
9797

9898
At least to me, this makes a lot of sense. We fight recursion with recursion! First, we first output the node we are on and then we call `DFS_recursive(...)` on each of its children nodes. This method of tree traversal does what its name implies: it goes to the depths of the tree first before going through the rest of the branches. In this case, the ordering looks like:
@@ -148,7 +148,7 @@ Now, in this case the first element searched through is still the root of the tr
148148
{% sample lang="coco" %}
149149
[import:11-15, lang:="coconut"](codo/coconut/tree_traversal.coco)
150150
{% sample lang="scala" %}
151-
[import:35-42, lang:"scala"](code/scala/tree.scala)
151+
[import:36-43, lang:"scala"](code/scala/tree.scala)
152152
{% endmethod %}
153153

154154
<p>
@@ -199,7 +199,7 @@ In this case, the first node visited is at the bottom of the tree and moves up t
199199
{% sample lang="coco" %}
200200
[import:17-30, lang:"coconut"](code/coconut/tree_traversal.coco)
201201
{% sample lang="scala" %}
202-
[import:44-59, lang:"scala"](code/scala/tree.scala)
202+
[import:45-60, lang:"scala"](code/scala/tree.scala)
203203
{% endmethod %}
204204

205205
<p>
@@ -312,7 +312,7 @@ And this is exactly what Breadth-First Search (BFS) does! On top of that, it can
312312
{% sample lang="coco" %}
313313
[import:41-48, lang:"coconut"](code/coconut/tree_traversal.coco)
314314
{% sample lang="scala" %}
315-
[import:71-78, lang:"scala"](code/scala/tree.scala)
315+
[import:72-80, lang:"scala"](code/scala/tree.scala)
316316
{% endmethod %}
317317

318318
## Video Explanation
@@ -382,7 +382,6 @@ The code snippets were taken from this [Scratch project](https://scratch.mit.edu
382382
{% endmethod %}
383383

384384

385-
386385
<script>
387386
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
388387
</script>

0 commit comments

Comments
 (0)