i'm trying to draw binary tree using GraphViz but i have problems about left child and right child. There is a way to force a node to be right or left child? This is my sample code:
digraph G{
5 -> 3;
5 -> 8;
3 -> 1;
3 -> 4;
8 -> 6;
8 -> 12;
}
This should do it. ordering=out
means the nodes should stay in order specified in the input.
digraph G{
graph [ordering="out"];
5 -> 3;
5 -> 8;
3 -> 1;
3 -> 4;
8 -> 6;
8 -> 12;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With