@@ -14,10 +14,8 @@ Trees are naturally recursive data structures, and because of this, we cannot ac
14
14
{% sample lang="js" %}
15
15
This has not been implemented in your chosen language, so here is the Julia code
16
16
[ import:3-7, lang:"julia"] ( code/julia/Tree.jl )
17
- {% sample lang="py2" %}
18
- [ import:1-5, lang:"python"] ( code/python2/Tree_example.py )
19
- {% sample lang="py3" %}
20
- [ import:5-10, lang:"python"] ( code/python3/Tree_example.py )
17
+ {% sample lang="py" %}
18
+ [ import:4-8, lang:"python"] ( code/python/Tree_example.py )
21
19
{% sample lang="scratch" %}
22
20
This has not been implemented in your chosen language, so here is the Julia code
23
21
[ import:3-7, lang:"julia"] ( code/julia/Tree.jl )
@@ -41,7 +39,7 @@ Because of this, the most straightforward way to traverse the tree might be recu
41
39
{% sample lang="js" %}
42
40
[ import:15-23, lang:"javascript"] ( code/javascript/Tree_example.js )
43
41
{% sample lang="py2" %}
44
- [ import:8-16 , lang:"python"] ( code/python2 /Tree_example.py )
42
+ [ import:10-18 , lang:"python"] ( code/python /Tree_example.py )
45
43
{% sample lang="py3" %}
46
44
This has not been implemented in your chosen language, so here is the Julia code
47
45
[ import:9-16, lang:"julia"] ( code/julia/Tree.jl )
@@ -156,10 +154,8 @@ In code, it looks like this:
156
154
[ import:75-93, lang:"c_cpp"] ( code/c/tree_traversal.c )
157
155
{% sample lang="js" %}
158
156
[ import:25-40, lang:"javascript"] ( code/javascript/Tree_example.js )
159
- {% sample lang="py2" %}
160
- [ import:25-36, lang:"python"] ( code/python2/Tree_example.py )
161
- {% sample lang="py3" %}
162
- [ import:31-45, lang:"python"] ( code/python3/Tree_example.py )
157
+ {% sample lang="py" %}
158
+ [ import:27-38, lang:"python"] ( code/python/Tree_example.py )
163
159
{% sample lang="scratch" %}
164
160
This has not been implemented in your chosen language, so here is the Julia code
165
161
[ import:45-56, lang:"julia"] ( code/julia/Tree.jl )
@@ -189,10 +185,8 @@ And this is exactly what Breadth-First Search (BFS) does! On top of that, it can
189
185
[ import:95-113, lang:"c_cpp"] ( code/c/tree_traversal.c )
190
186
{% sample lang="js" %}
191
187
[ import:42-57, lang:"javascript"] ( code/javascript/Tree_example.js )
192
- {% sample lang="py2" %}
193
- [ import:38-49, lang:"python"] ( code/python2/Tree_example.py )
194
- {% sample lang="py3" %}
195
- [ import:48-62, lang:"python"] ( code/python3/Tree_example.py )
188
+ {% sample lang="py" %}
189
+ [ import:40-51, lang:"python"] ( code/python/Tree_example.py )
196
190
{% sample lang="scratch" %}
197
191
This has not been implemented in your chosen language, so here is the Julia code
198
192
[ import:58-69, lang:"julia"] ( code/julia/Tree.jl )
@@ -225,12 +219,9 @@ tree_traversal.c
225
219
{% sample lang="js" %}
226
220
### JavaScript
227
221
[ import, lang:"javascript"] ( code/javascript/Tree_example.js )
228
- {% sample lang="py2" %}
229
- ### Python 2
230
- [ import, lang:"python"] ( code/python2/Tree_example.py )
231
- {% sample lang="py3" %}
232
- ### Python 3
233
- [ import, lang:"python"] ( code/python3/Tree_example.py )
222
+ {% sample lang="py" %}
223
+ ### Python
224
+ [ import, lang:"python"] ( code/python/Tree_example.py )
234
225
{% sample lang="scratch" %}
235
226
### Scratch
236
227
![ scratch tree] ( code/scratch/scratch_tree.png )
0 commit comments