* Brian <[EMAIL PROTECTED]> [2006-05-02 07:06]:
> I am reading through the tree(3), and I need some clarification. If I want to
> correctly remove an element from a red black tree that I have found and free
> it's memory allocation, this code should work, right?
>
> find.i = 400;
> n = RB_FIND(
.. Either way, you don't need to worry about the return
value of RB_REMOVE, just use the value returned by RB_FIND() directly.
> I ask because the man page is clear for splay trees, but I am not
> certain for Red Black trees. I looked at /usr/include/sys/tree.h, and
> I did not find an
n = RB_REMOVE(inttree, &head, n);
free(n);
} else if (n == NULL)
(void)printf("satisfied NULL check\n");
I ask because the man page is clear for splay trees, but I am not certain for
Red Black trees. I looked at /usr/include/sys/tree.h, and I did not find any
explicit fr
3 matches
Mail list logo