if right[x] != NIL
then return TREE-MINIMUM(right[x])
y<-p[x]
while y!= NIL and x = right[y]
do x<-y
y<-p[y]
return y
我知道什么是“正确的,如果[X] = NIL然后返回树民!”的意思,我已经将它翻译成:是什么伪代码的意思是 - 二叉搜索树后继函数
if(p->RChild) return fMinValue(p->RChild);//returns the min value of the sub-tree starting at the right child node of p
其他我无法理解。
p [x]和p [y]。 p是指针,而[]的内容是p指向的内容? 编辑:=)现在有道理。谢谢! – Azreal 2010-02-21 05:02:59
我读它的方式,'p [x]'是返回节点'x'的父节点的函数。那么'right [x]'是'x'的右边孩子。 – 2010-02-21 05:07:36