Messages in this thread | | | Date | Tue, 30 Nov 1999 15:14:07 +0100 (CET) | From | Andrea Arcangeli <> | Subject | Re: [patch] rbtrees [was Re: AVL trees vs. Red-Black trees] |
| |
On Tue, 30 Nov 1999, Kevin O'Connor wrote:
>[..] I've got inserts working, but >removes are becoming a myriad of special cases..
removes are trivial with rbtrees as you never need to compare nodes. All the rebalancing is done in function of the node color (that is a private information of each node). The same is true also for the insert-rebalancing, but to do an insert you must first browse the tree to do a normal ordered O(log(n)) insert before calling the rebalance (thus a compare semantic on elements is necessary for the insert operation to work).
Andrea
- 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/
| |