Skip to content

Commit d703be6

Browse files
[binary-search-tree] Four SVG graphs (#2285)
* Added four SVG graphs * [typo] Add missing "tree-" filename prefixes * Update exercises/binary-search-tree/description.md Co-authored-by: Jeremy Walker <jez.walker@gmail.com> * Move images inline * Moved non-inline links * Switch to assets.exercism.org * Keep ascii art for shell usage --------- Co-authored-by: Jeremy Walker <jez.walker@gmail.com>
1 parent 3858910 commit d703be6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

exercises/binary-search-tree/description.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,52 @@ All data in the left subtree is less than or equal to the current node's data, a
1919

2020
For example, if we had a node containing the data 4, and we added the data 2, our tree would look like this:
2121

22+
![A graph with root node 4 and a single child node 2.](https://assets.exercism.org/images/exercises/binary-search-tree/tree-4-2.svg)
23+
24+
```text
2225
4
2326
/
2427
2
28+
```
2529

2630
If we then added 6, it would look like this:
2731

32+
![A graph with root node 4 and two child nodes 2 and 6.](https://assets.exercism.org/images/exercises/binary-search-tree/tree-4-2-6.svg)
33+
34+
```text
2835
4
2936
/ \
3037
2 6
38+
```
3139

3240
If we then added 3, it would look like this
3341

42+
![A graph with root node 4, two child nodes 2 and 6, and a grandchild node 3.](https://assets.exercism.org/images/exercises/binary-search-tree/tree-4-2-6-3.svg)
43+
44+
```text
3445
4
3546
/ \
3647
2 6
3748
\
3849
3
50+
```
3951

4052
And if we then added 1, 5, and 7, it would look like this
4153

54+
![A graph with root node 4, two child nodes 2 and 6, and four grandchild nodes 1, 3, 5 and 7.](https://assets.exercism.org/images/exercises/binary-search-tree/tree-4-2-6-1-3-5-7.svg)
55+
56+
```text
4257
4
4358
/ \
4459
/ \
4560
2 6
4661
/ \ / \
4762
1 3 5 7
63+
```
64+
65+
## Credit
66+
67+
The images were created by [habere-et-dispertire][habere-et-dispertire] using [PGF/TikZ][pgf-tikz] by Till Tantau.
68+
69+
[habere-et-dispertire]: https://exercism.org/profiles/habere-et-dispertire
70+
[pgf-tikz]: https://en.wikipedia.org/wiki/PGF/TikZ

0 commit comments

Comments
 (0)