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

Added visualise for red black tree #73

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

aveldan
Copy link
Contributor

@aveldan aveldan commented Jul 15, 2024

For issue #71

For an example like this

red_black_tree<int> rb({1, 2, 12, 14, 89, 3, 0, 13});
rb.visualize();

This is the dot file generated

digraph Tree {
2 [shape=circle fontcolor=black color=black]
1 [shape=circle fontcolor=black color=black]
2->1
0 [shape=circle fontcolor=black color=red]
1->0
14 [shape=circle fontcolor=black color=red]
2->14
12 [shape=circle fontcolor=black color=black]
14->12
3 [shape=circle fontcolor=black color=red]
12->3
13 [shape=circle fontcolor=black color=red]
12->13
89 [shape=circle fontcolor=black color=black]
14->89
}

And this is how it is rendered

Screenshot from 2024-07-15 12-37-13

@spirosmaggioros spirosmaggioros self-requested a review July 16, 2024 20:18
@spirosmaggioros spirosmaggioros added the Tree Related to tree classes and/or functions for trees label Jul 16, 2024
@spirosmaggioros spirosmaggioros merged commit b2c568a into CSRT-NTUA:main Jul 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tree Related to tree classes and/or functions for trees
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants