Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[binary-search-tree] Four SVG graphs #2285

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions exercises/binary-search-tree/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,25 @@ All data in the left subtree is less than or equal to the current node's data, a

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

4
/
2
[A graph with root node 4 and a single child node 2.][4-2]

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

4
/ \
2 6
[A graph with root node 4 and two child nodes 2 and 6.][4-2-6]

If we then added 3, it would look like this

4
/ \
2 6
\
3
[A graph with root node 4, two child nodes 2 and 6, and a grandchild node 3.][4-2-6-3]

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

4
/ \
/ \
2 6
/ \ / \
1 3 5 7
[A graph with root node 4, two child nodes 2 and 6, and four grandchild nodes 1, 3, 5 and 7.][4-2-6-1-3-5-7]

## Credit

The images were created by [habere-et-dispertire](https://exercism.org/profiles/habere-et-dispertire) using [PGF/TikZ](https://en.wikipedia.org/wiki/PGF/TikZ) by Till Tantau.

[4-2]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/binary-search-tree/tree-4-2.svg
[4-2-6]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/binary-search-tree/tree-4-2-6.svg
[4-2-6-3]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/binary-search-tree/tree-4-2-6-3.svg
[4-2-6-1-3-5-7]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/binary-search-tree/tree-4-2-6-1-3-5-7.svg