代码
digraph RedBlackTree {
node [fontname="Arial", shape=circle, style=filled, color="#ffffff", fillcolor="#ff0000", fontsize=12, width=0.5, height=0.5];
edge [fontname="Arial", fontsize=10, color="#333333", arrowsize=0.5];
NULL [shape=point];
node1 [label="1", fontcolor=white, fillcolor=black];
node2 [label="2", fontcolor=white, fillcolor=red];
node3 [label="3", fontcolor=white, fillcolor=black];
node4 [label="4", fontcolor=white, fillcolor=black];
node5 [label="5", fontcolor=white, fillcolor=black];
node6 [label="6", fontcolor=white, fillcolor=red];
node7 [label="7", fontcolor=white, fillcolor=black];
NULL -> node1;
node1 -> node2;
node1 -> node3;
node2 -> node4;
node2 -> node5;
node3 -> node6;
node3 -> node7;
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
效果