一、数组
digraph demo {
n [label="{1|2|3}" shape=record]
}
效果:
如果希望数组横过来,要设置全局的rankdir
属性:
digraph demo {
rankdir=LR
n [label="{1|2|3}" shape=record]
}
效果:
二、链表节点
digraph demo {
rankdir=LR
n1 [label="{<data>data|<next>}" shape=record]
n2 [label="{<data>data|<next>}" shape=record]
n3 [label="{<data>data|<next>nil}" shape=record]
n1:next:0 -> n2:data [tailclip=false]
n2:next:0 -> n3:data [tailclip=false]
}
效果:
此处评论已关闭