Posted Nov 7, 2009 23:55 UTC (Sat) by acolin (guest, #61859)
Parent article: Trees II: red-black trees
Thank you for the article!
Note that in my_rb_insert parent must be initialized, otherwise it doesn't work. This can also be seen in example in rbtree.h. So,
> struct rb_node **link = &root->rb_node, *parent;
should be
> struct rb_node **link = &root->rb_node, *parent = NULL;