Skip to content

Commit 9b40580

Browse files
Julianzsparal
Julian
authored andcommitted
change the name golang to go (#490)
1 parent 70b508c commit 9b40580

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

contents/bubble_sort/bubble_sort.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This means that we need to go through the vector $$\mathcal{O}(n^2)$$ times with
3535
{% sample lang="d" %}
3636
[import:3-18, lang:"d"](code/d/bubble_sort.d)
3737
{% sample lang="go" %}
38-
[import:7-21, lang:"golang"](code/go/bubbleSort.go)
38+
[import:7-21, lang:"go"](code/go/bubbleSort.go)
3939
{% sample lang="racket" %}
4040
[import:6-19, lang:"scheme"](code/racket/bubbleSort.rkt)
4141
{% sample lang="swift" %}
@@ -104,7 +104,7 @@ Trust me, there are plenty of more complicated algorithms that do precisely the
104104
{% sample lang="d" %}
105105
[import, lang:"d"](code/d/bubble_sort.d)
106106
{% sample lang="go" %}
107-
[import, lang:"golang"](code/go/bubbleSort.go)
107+
[import, lang:"go"](code/go/bubbleSort.go)
108108
{% sample lang="racket" %}
109109
[import, lang:"scheme"](code/racket/bubbleSort.rkt)
110110
{% sample lang="swift" %}

contents/euclidean_algorithm/euclidean_algorithm.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The algorithm is a simple way to find the *greatest common divisor* (GCD) of two
2828
{% sample lang="ml" %}
2929
[import:9-17, lang="ocaml"](code/ocaml/euclidean_example.ml)
3030
{% sample lang="go" %}
31-
[import:25-38, lang="golang"](code/go/euclidean.go)
31+
[import:25-38, lang="go"](code/go/euclidean.go)
3232
{% sample lang="swift" %}
3333
[import:1-14, lang="swift"](code/swift/euclidean_algorithm.swift)
3434
{% sample lang="matlab" %}
@@ -91,7 +91,7 @@ Modern implementations, though, often use the modulus operator (%) like so
9191
{% sample lang="ml" %}
9292
[import:3-7, lang="ocaml"](code/ocaml/euclidean_example.ml)
9393
{% sample lang="go" %}
94-
[import:14-23, lang="golang"](code/go/euclidean.go)
94+
[import:14-23, lang="go"](code/go/euclidean.go)
9595
{% sample lang="swift" %}
9696
[import:16-27, lang="swift"](code/swift/euclidean_algorithm.swift)
9797
{% sample lang="matlab" %}
@@ -159,7 +159,7 @@ The Euclidean Algorithm is truly fundamental to many other algorithms throughout
159159
{% sample lang="ml" %}
160160
[import, lang="ocaml"](code/ocaml/euclidean_example.ml)
161161
{% sample lang="go" %}
162-
[import, lang="golang"](code/go/euclidean.go)
162+
[import, lang="go"](code/go/euclidean.go)
163163
{% sample lang="swift" %}
164164
[import, lang="swift"](code/swift/euclidean_algorithm.swift)
165165
{% sample lang="matlab" %}

contents/monte_carlo_integration/monte_carlo_integration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ each point is tested to see whether it's in the circle or not:
5454
{% sample lang="d" %}
5555
[import:2-5, lang:"d"](code/d/monte_carlo.d)
5656
{% sample lang="go" %}
57-
[import:12-14, lang:"golang"](code/go/monteCarlo.go)
57+
[import:12-14, lang:"go"](code/go/monteCarlo.go)
5858
{% sample lang="r" %}
5959
[import:2-6, lang:"r"](code/r/monte_carlo.R)
6060
{% sample lang="java" %}
@@ -129,7 +129,7 @@ Feel free to submit your version via pull request, and thanks for reading!
129129
{%sample lang="d" %}
130130
[import, lang:"d"](code/d/monte_carlo.d)
131131
{%sample lang="go" %}
132-
[import, lang:"golang"](code/go/monteCarlo.go)
132+
[import, lang:"go"](code/go/monteCarlo.go)
133133
{%sample lang="r" %}
134134
[import, lang:"r"](code/r/monte_carlo.R)
135135
{% sample lang="java" %}

contents/tree_traversal/tree_traversal.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This has not been implemented in your chosen language, so here is the Julia code
3333
{% sample lang="crystal" %}
3434
[import:1-5, lang:"crystal"](code/crystal/tree-traversal.cr)
3535
{% sample lang="go" %}
36-
[import:5-8, lang:"golang"](code/golang/treetraversal.go)
36+
[import:5-8, lang:"go"](code/golang/treetraversal.go)
3737
{% endmethod %}
3838

3939
Because of this, the most straightforward way to traverse the tree might be recursive. This naturally leads us to the Depth-First Search (DFS) method:
@@ -69,7 +69,7 @@ Because of this, the most straightforward way to traverse the tree might be recu
6969
{% sample lang="crystal" %}
7070
[import:7-10, lang:"crystal"](code/crystal/tree-traversal.cr)
7171
{% sample lang="go" %}
72-
[import:10-15, lang:"golang"](code/golang/treetraversal.go)
72+
[import:10-15, lang:"go"](code/golang/treetraversal.go)
7373
{% endmethod %}
7474

7575
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:
@@ -113,7 +113,7 @@ Now, in this case the first element searched through is still the root of the tr
113113
{% sample lang="crystal" %}
114114
[import:12-15, lang:"crystal"](code/crystal/tree-traversal.cr)
115115
{% sample lang="go" %}
116-
[import:17-22, lang:"golang"](code/golang/treetraversal.go)
116+
[import:17-22, lang:"go"](code/golang/treetraversal.go)
117117
{% endmethod %}
118118

119119
<p>
@@ -152,7 +152,7 @@ In this case, the first node visited is at the bottom of the tree and moves up t
152152
{% sample lang="crystal" %}
153153
[import:17-31, lang:"crystal"](code/crystal/tree-traversal.cr)
154154
{% sample lang="go" %}
155-
[import:24-38, lang:"golang"](code/golang/treetraversal.go)
155+
[import:24-38, lang:"go"](code/golang/treetraversal.go)
156156
{% endmethod %}
157157

158158
<p>
@@ -201,7 +201,7 @@ In code, it looks like this:
201201
{% sample lang="crystal" %}
202202
[import:33-41, lang:"crystal"](code/crystal/tree-traversal.cr)
203203
{% sample lang="go" %}
204-
[import:40-49, lang:"golang"](code/golang/treetraversal.go)
204+
[import:40-49, lang:"go"](code/golang/treetraversal.go)
205205
{% endmethod %}
206206

207207
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:
@@ -242,7 +242,7 @@ And this is exactly what Breadth-First Search (BFS) does! On top of that, it can
242242
{% sample lang="crystal" %}
243243
[import:43-51, lang:"crystal"](code/crystal/tree-traversal.cr)
244244
{% sample lang="go" %}
245-
[import:51-60, lang:"golang"](code/golang/treetraversal.go)
245+
[import:51-60, lang:"go"](code/golang/treetraversal.go)
246246
{% endmethod %}
247247

248248
## Example Code
@@ -285,7 +285,7 @@ The code snippets were taken from this [Scratch project](https://scratch.mit.edu
285285
{% sample lang="crystal" %}
286286
[import, lang:"crystal"](code/crystal/tree-traversal.cr)
287287
{% sample lang="go" %}
288-
[import, lang:"golang"](code/golang/treetraversal.go)
288+
[import, lang:"go"](code/golang/treetraversal.go)
289289
{% endmethod %}
290290

291291

0 commit comments

Comments
 (0)