尝试在C中实现RBtree
我试图在C中实现RB树,但编译器总是在出现特定错误时失败:“取消引用指向不完整类型的指针” 我声明了以下结构:尝试在C中实现RBtree,c,C,我试图在C中实现RB树,但编译器总是在出现特定错误时失败:“取消引用指向不完整类型的指针” 我声明了以下结构: `typedef struct costumer_tree { int id; char lastName[100]; int color; struct costumers_tree * left; struct costumers_tree * right; struct costumers_tree * parent; } co
`typedef struct costumer_tree
{
int id;
char lastName[100];
int color;
struct costumers_tree * left;
struct costumers_tree * right;
struct costumers_tree * parent;
}
costumerTree;`
并使用RBfix函数:
`treeInsertFixup(costumerTree *costumerTreeRoot, costumerTree *z)
{
costumerTree *y;
while (z->parent->color == 2)
{
...}`
但当我编译代码时,该行的编译总是失败:
while(z->parent->color==2)
出现错误:“取消对不完整类型的指针的引用”
为什么我是密松
谢谢,
结构客户树
从未定义过<代码>结构客户树是。结构客户树
从未定义<代码>结构客户树是。哦,真让我羞愧,花了我一段时间,非常感谢!!哦,真丢脸,花了我一段时间,非常感谢!!