annotate tex/rbtree.tex @ 7:acad18934981

add description of rbtree
author soto@cr.ie.u-ryukyu.ac.jp
date Mon, 14 Sep 2020 05:41:23 +0900
parents
children a8bc8c6b48bd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 \section{赤黒木}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 赤黒木とは平衡2分探索木の一つである。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3 2分探索木の点にランクという概念を追加し、そのランクの違いを赤と黒の色で分け、以下の定義に基づくように
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4 木を構成した物である。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6 \begin{enumerate}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
7 \item 各点は赤か黒の色である。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
8 \item 点が赤である場合の親となる点の色は黒である。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
9 \item 外点(葉。つまり一番下の点)は黒である。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
10 \item 任意の点から外点までの黒色の点はいずれも同数となる。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
11 \end{enumerate}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
12 参考となるグラフを以下に示す。上記の定義を満たしていることが分かる。
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
13 \begin{center}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
14 \includegraphics[height=3.5cm]{pic/rbtree.pdf}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
15 \caption{CodeGear、DataGear での Hoare Logic}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
16 \label{hoare}
acad18934981 add description of rbtree
soto@cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
17 \end{center}