tree->root.color = black;
tree->root.data = NULL;
- return(tree);
+ return tree;
}
/*
while (node != rbnil(tree)) {
parent = node;
if ((res = tree->compar(data, node->data)) == 0)
- return(node);
+ return node;
node = res < 0 ? node->left : node->right;
}
}
}
rbfirst(tree)->color = black; /* first node is always black */
- return(NULL);
+ return NULL;
}
/*
while (node != rbnil(tree)) {
if ((res = tree->compar(key, node->data)) == 0)
- return(node);
+ return node;
node = res < 0 ? node->left : node->right;
}
- return(NULL);
+ return NULL;
}
/*
if (node != rbnil(tree)) {
if (order == preorder)
if ((error = func(node->data, cookie)) != 0)
- return(error);
+ return error;
if ((error = rbapply_node(tree, node->left, func, cookie, order)) != 0)
- return(error);
+ return error;
if (order == inorder)
if ((error = func(node->data, cookie)) != 0)
- return(error);
+ return error;
if ((error = rbapply_node(tree, node->right, func, cookie, order)) != 0)
- return(error);
+ return error;
if (order == postorder)
if ((error = func(node->data, cookie)) != 0)
- return(error);
+ return error;
}
- return (0);
+ return 0;
}
/*
if (succ == rbroot(tree))
succ = rbnil(tree);
}
- return(succ);
+ return succ;
}
/*
}
free(z);
- return (data);
+ return data;
}
/*