设二叉排序树的存储结构为
TYPE tree=^node;
node=RECORD
key: keytype;
size:int;
lchild rchild parents: tree;
END;
一个结点x^的size域的值是以该结点为根的子树中结点的总数(包括x^本身)例如下图中x所指结点的sixe值为设树高为h试写一时间为O(h)的算法Rank(T:tree;x:^node)返回x所指结点在二叉排序树T的中序序列里的排序序号即求x^结点是根为T的二叉排序树中第几个最小元素例如下图x所指结点是树T中第个最小元素(提示你可利用size值和双亲指针parents)【中科院软件所 四(分)】【中国科学技术大学 】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []