Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试在C中实现RBtree_C - Fatal编程技术网

尝试在C中实现RBtree

尝试在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

我试图在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;
}
costumerTree;`
并使用RBfix函数:

`treeInsertFixup(costumerTree *costumerTreeRoot, costumerTree *z)
{
costumerTree *y;
while (z->parent->color == 2)
{
...}`
但当我编译代码时,该行的编译总是失败:
while(z->parent->color==2)
出现错误:“取消对不完整类型的指针的引用”

为什么我是密松


谢谢,

结构客户树
从未定义过<代码>结构客户树是。

结构客户树
从未定义<代码>结构客户树是。

哦,真让我羞愧,花了我一段时间,非常感谢!!哦,真丢脸,花了我一段时间,非常感谢!!