lkml.org 
[lkml]   [1999]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] rbtrees [was Re: AVL trees vs. Red-Black trees]
Andrea Arcangeli wrote:
> + To use rbtrees you'll have to implement your own insert and search cores.
> + This will avoid us to use callbacks and to drop drammatically performances.
> + I know it's not the cleaner way, but in C (not in C++) to get
> + performances and genericity...
> +
> + Some example of insert and search follows here. The search is a plain
> + normal search over an ordered tree. The insert instead must be implemented
> + int two steps: as first thing the code must insert the element in
> + order as a red leaf in the tree, then the support library function
> + rb_insert_color() must be called. Such function will do the
> + not trivial work to rebalance the rbtree if necessary.

What about something similar to the "end_request()" implementation?

ie you #define a name and the (inline) compare function, then you
#include <rbtree.h>. <rbtree.h> creates all functions that you need.

--
Manfred

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.060 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site