Skip to content

Commit 10af60f

Browse files
Wesley-Arringtonleios
authored andcommitted
Small change to two .md files (#235)
- Changing tree_traversal.md to show rust code - Putting ###Haskell in correct place (currently it shows up after the Rust code)
1 parent afb2dbb commit 10af60f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

chapters/matrix_methods/gaussian_elimination/gaussian_elimination.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ In code, this looks like:
259259
[import:1-42, lang:"julia"](code/julia/gaussian_elimination.jl)
260260
{% sample lang="c" %}
261261
[import:13-44, lang:"c_cpp"](code/c/gaussian_elimination.c)
262+
{% sample lang="rs" %}
263+
[import:41-78, lang:"rust"](code/rust/gaussian_elimination.rs)
262264
{% endmethod %}
263265

264266
As with all code, it takes time to fully absorb what is going on and why everything is happening; however, I have tried to comment the above psuedocode with the necessary steps. Let me know if anything is unclear!
@@ -274,6 +276,8 @@ Even though this seems straightforward, the pseudocode might not be as simple as
274276
[import:44-64, lang:"julia"](code/julia/gaussian_elimination.jl)
275277
{% sample lang="c" %}
276278
[import:46-58, lang:"c_cpp"](code/c/gaussian_elimination.c)
279+
{% sample lang="rs" %}
280+
[import:79-94, lang:"rust"](code/rust/gaussian_elimination.rs)
277281
{% endmethod %}
278282

279283
Now, as for what's next... Well, we are in for a treat! The above algorithm clearly has 3 `for` loops, and will thus have a complexity of $$\sim O(n^3)$$, which is abysmal! If we can reduce the matrix to a specifically **tridiagonal** matrix, we can actually solve the system in $$\sim O(n)$$! How? Well, we can use an algorithm known as the _Tri-Diagonal Matrix Algorithm_ \(TDMA\) also known as the _Thomas Algorithm_.

chapters/tree_traversal/tree_traversal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ MainClass.java
235235
{% sample lang="rs"%}
236236
### Rust
237237
[import, lang:"rust"](code/rust/tree.rs)
238-
### Haskell
239238
{% sample lang="hs"%}
239+
### Haskell
240240
[import, lang:"haskell"](code/haskell/TreeTraversal.hs)
241241
{% endmethod %}
242242

0 commit comments

Comments
 (0)