.()p:=p^lchild ()()p:=Sdata[stop]^rchild ()stop=
()*ppos // 根結點 ()rpos=ipos ()rposipos ()ipos ()ppos+
()top> ()stack[top]:=nd^right ()nd^left<>NIL ()top:=top+ (左子樹非空)
() p<>thr // 未循環結束 ()p>ltag= ()p>lchild ()p>rtag= && p>rchild!=thr () p=p>rchild ()p=p>rchild
若p^rtag=則p^rchild 為後繼否則p的後繼是p的右子樹中最左下的結點
()q=p^rchild ()q^ltag= () q^lchild
.()tree>lchild ()null ()pre>rchild ()pre>rtag= () pre>right=tree; () tree>right (注()和()順序可換)
.()node>rflag== ()*x=bt () *x=node>right
[] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/23152.html