【发布时间】:2022-01-23 05:58:36
【问题描述】:
我使用 Graphviz(点)绘制了一个双向链表,如下所示,但节点未对齐。如何对齐节点?
digraph "Doubly Linked List" {
rankdir=LR;
node [shape=record];
e [label="nil" shape=circle];
a [label="{ <ref1> | <data> 1 | <ref2> }"]
b [label="{ <ref1> | <data> 5 | <ref2> }"];
c [label="{ <ref1> | <data> 7 | <ref2> }"];
d [label="nil" shape=circle];
e -> a:ref1:c [arrowhead=dot, arrowtail=vee, dir=both, headclip=false];
a:ref2:c -> b:data:n [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
b:ref2:c -> c:data:n [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
c:ref2:c -> d [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
c:ref1:c -> b:data:s [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
b:ref1:c -> a:data:s [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
}
【问题讨论】:
标签: linked-list graphviz doubly-linked-list dot