Skip to content

Commit

Permalink
[RBT] Removed some non-ASCII letters
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Liu committed Nov 13, 2014
1 parent a53171c commit 1a3738e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions datastruct/tree/red-black-tree/rbtree-en.tex
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ \subsection{Tree rotation}
\begin{algorithmic}[1]
\Function{Left-Rotate}{$T, x$}
\State $p \gets$ \Call{Parent}{$x$}
\State $y \gets$ \Call{Right}{$x$} \Comment{Assume $y \ne NIL$}
\State $y \gets$ \Call{Right}{$x$} \Comment{Assume $y \ne$ NIL}
\State $a \gets$ \Call{Left}{$x$}
\State $b \gets$ \Call{Left}{$y$}
\State $c \gets$ \Call{Right}{$y$}
\State \Call{Replace}{$x, y$}
\State \Call{Set-Children}{$x, a, b$}
\State \Call{Set-Children}{$y, x, c$}
\If{$p = NIL$}
\If{$p = $ NIL}
\State $T \gets y$
\EndIf
\State \Return $T$
Expand All @@ -211,14 +211,14 @@ \subsection{Tree rotation}

\Function{Right-Rotate}{$T, y$}
\State $p \gets$ \Call{Parent}{$y$}
\State $x \gets$ \Call{Left}{$y$} \Comment{Assume $x \ne NIL$}
\State $x \gets$ \Call{Left}{$y$} \Comment{Assume $x \ne$ NIL}
\State $a \gets$ \Call{Left}{$x$}
\State $b \gets$ \Call{Right}{$x$}
\State $c \gets$ \Call{Right}{$y$}
\State \Call{Replace}{$y, x$}
\State \Call{Set-Children}{$y, b, c$}
\State \Call{Set-Children}{$x, a, y$}
\If{$p = NIL$}
\If{$p = $ NIL}
\State $T \gets x$
\EndIf
\State \Return $T$
Expand All @@ -228,7 +228,7 @@ \subsection{Tree rotation}

\Function{Set-Left}{$x, y$}
\State \Call{Left}{$x$} $\gets y$
\If{$y \ne NIL$}
\If{$y \ne$ NIL}
\Call{Parent}{$y$} $\gets x$
\EndIf
\EndFunction
Expand All @@ -237,7 +237,7 @@ \subsection{Tree rotation}

\Function{Set-Right}{$x, y$}
\State \Call{Right}{$x$} $\gets y$
\If{$y \ne NIL$}
\If{$y \ne$ NIL}
\Call{Parent}{$y$} $\gets x$
\EndIf
\EndFunction
Expand All @@ -252,16 +252,16 @@ \subsection{Tree rotation}
\Statex

\Function{Replace}{$x, y$}
\If{\Call{Parent}{$x$} $= NIL$}
\If{$y \ne NIL$}
\Call{Parent}{$y$} $\gets NIL$
\If{\Call{Parent}{$x$} = NIL}
\If{$y \ne$ NIL}
\Call{Parent}{$y$} $\gets$ NIL
\EndIf
\ElsIf{\textproc{Left}(\Call{Parent}{$x$}) $= x$}
\State \textproc{Set-Left}(\Call{Parent}{$x$}, $y$)
\Else
\State \textproc{Set-Right}(\Call{Parent}{$x$}, $y$)
\EndIf
\State \Call{Parent}{$x$} $\gets NIL$
\State \Call{Parent}{$x$} $\gets$ NIL
\EndFunction
\end{algorithmic}

Expand Down Expand Up @@ -417,7 +417,7 @@ \section{Insertion}
\end{figure}

Note that this transformation will move the redness one level up.
So this is a bottom-up recursive fixing, the last step will make
During the bottom-up recursive fixing, the last step will make
the root node red. According to property 2, root is always black.
Thus we need final fixing to revert the root color to black.

Expand Down Expand Up @@ -894,11 +894,11 @@ \section{Deletion}
where $p 3.1$ and $p 3.2$ are two patterns as the following.

\[
p 3.1 £º \{ color(T) = \mathcal{B} \land color(T_l) = \mathcal{B}^2 \land color(T_r) = \mathcal{R} \}
p 3.1 : \{ color(T) = \mathcal{B} \land color(T_l) = \mathcal{B}^2 \land color(T_r) = \mathcal{R} \}
\]

\[
p 3.2 £º \{ color(T) = \mathcal{B} \land color(T_l) = \mathcal{R} \land color(T_r) = \mathcal{B}^2 \}
p 3.2 : \{ color(T) = \mathcal{B} \land color(T_l) = \mathcal{R} \land color(T_r) = \mathcal{B}^2 \}
\]


Expand Down Expand Up @@ -1134,7 +1134,7 @@ \section{More words}
Red-black tree is the most popular implementation of balanced binary search
tree. Another one is the AVL tree, which we'll introduce in next chapter.
Red-black tree can be a good start point for more data structures. If we
extend the number of children from 2 to $K$, and keep the balance as well,
extend the number of children from 2 to $k$, and keep the balance as well,
it leads to B-tree, If we store the data along with edge but not inside
node, it leads to Tries. However, the multiple cases handling and the long
program tends to make new comers think red-black tree is complex.
Expand Down

0 comments on commit 1a3738e

Please sign in to comment.