红黑树的创建+线索化+性质检验+笔画输入法(四)

2014-11-24 08:11:11 · 作者: · 浏览: 1
{
RedBlackNode * pre = NULL;
*thrt = (RedBlackNode *)malloc(sizeof(RedBlackNode));
if(*thrt == NULL)
{
printf("exit!\n");
exit(0);
}
memset(*thrt, 0, sizeof(RedBlackNode));
(*thrt)->ltag = Link;
(*thrt)->rtag = Thread;
(*thrt)->right = (*thrt);
if(root == NULL)(*thrt)->left = (*thrt);
else
{
(*thrt)->left = root;
pre = (*thrt);
InThreading(root, &pre);
pre->right = (*thrt);
pre->rtag = Thread;
(*thrt)->right = pre;
}
}