编程语言/二叉树:修订间差异
来自康健生活
| 第62行: | 第62行: | ||
{{Unknown|accord}} | {{Unknown|accord}} | ||
以下不满足搜索二叉树示例: | |||
<graphviz renderer='neato'> | <graphviz renderer='neato'> | ||
digraph binaryTree{ | digraph binaryTree{ | ||
| 第75行: | 第76行: | ||
} | } | ||
</graphviz> | </graphviz> | ||
===== 链式存储结构(三叉链表) ===== | |||
<graphviz renderer='neato'> | |||
digraph binaryTree{ | |||
node[shape=circle,color=red,fontcolor=blue,fontsize=10]; | |||
12[color=blue,fontcolor=black,fontsize=10]; | |||
12->4; | |||
12->18; | |||
4->1; | |||
4->8; | |||
21[style=filled]; | |||
18->21[style=dotted]; | |||
18->20; | |||
} | |||
</graphviz> | |||
==== 查找 ==== | |||
==== 遍历 ==== | |||
===== 中序遍历(inorder) ===== | |||
===== 前序遍历(preorder) ===== | |||
===== 后序遍历(postorder) ===== | |||