home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.theory
- Path: sparky!uunet!ukma!darwin.sura.net!max.fiu.edu!serss0!richard
- From: richard@serss0 (Richard A Simm)
- Subject: compressed trie table
- Organization: Florida International University, Miami
- Date: Fri, 6 Nov 1992 20:29:42 GMT
- Message-ID: <BxBA9J.Dz3@fiu.edu>
- Sender: news@fiu.edu (Usenet Administrator)
- Lines: 26
-
- In the latest 'Software, Practice & Experience', an article is presented
- detailing a new algorithm for handling tries. The new altorithm stores the
- trie in two one-dimensional arrays. Ambiguities are resolved in a third
- one-dimensional array. Apart from the sample code being buggy, I've run
- across a problem implementing the authors' algorithm. I want to insert
- the following two strings:
- to
- too
-
- If these are the only two strings I want to insert, then I do the following:
- to: use case 1.
- too: use case 3 but a problem arises. The string 'to' will be
- inserted in the BASE array. Because of this, I can no
- longer recognize the string 'to'. I can make a special case
- of one string being a subset of another in which case the
- shorter string would have a 0 tacked on to the end (like a
- C-style string) and then perform X_CHECK (1,'o'). The node
- returned by X_CHECK would then be used to help match 'to'
- by having as its value -1 to signal the end of the string.
- The reason for doing XHECK(1,'o') is so we have BASE[1] > 0.
-
-
- Any other ideas?
-
-
- Albert Chin richard@serss0.fiu.edu
-