Database
ternary.txt
Associated article: Ternary Search Trees
Tags: .NET Database
Published source code accompanying the article by Jon Bentley and Robert Sedgewick in which they examine ternary search trees which combine the time efficiency of digital tries with the space efficiency of binary search trees. Also see TERNARY.ZIP.
Algorithm Alley
by Jon Bentley and Bob Sedgewick
Listing One
typedef struct tnode *Tptr;
typedef struct tnode {
char splitchar;
Tptr lokid, eqkid, hikid;
} Tnode;
Listing Two
int rsearch(Tptr p, char *s)
{ if (!p) return 0;
if (*s < p->...


