The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Binary trees, non-unique values by mikosullivan 2002-06-12 05:04:11
Can anybody point to some good references on designing indexes using binary trees with non-unique values? Here's the issue I'm trying to understand: if you build a binary tree of unique record values, that's easy. Each node in the tree points to its own parent, to a lesser-than node, and a greater-than node. Now, suppose you want to organize a bunch of records in a binary tree, but the key for each record isn't necessarily unique. For example, you might have a dozen Smith's and two dozen Browns. How do you arrange those records in a binary tree? I briefly considered just changing the greater-than pointer to greater-than-or-equal-to, but then you have to cycle through every redundant value, which defeats the purpose of an index. What the usual algorithm for this situation?

-Miko

[ Reply ]
  A couple of possibilities... by Tomcat2002-06-12 05:51:20
    Traversing entire tree by mikosullivan2002-06-12 06:15:50
      Not necessarily by ninewands2002-06-12 08:16:10
        hash tables by mikosullivan2002-06-12 09:18:47
          couldn't each by tigermouse2002-06-12 09:45:44
  Cycle through ... not necessarily. by scissors2002-06-12 06:14:12
  Have you looked at the GLib implementation? by decadence2002-06-12 07:11:44
  What I'm going to try by mikosullivan2002-06-12 08:38:06
  Ternary search trees by zem422006-11-19 12:55:59

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)