CompuServe Messages

Help

    11-Aug-95 06:25:31
Sb: #47808-Help
Fm: Jim Butterfield 73624,14
To: john 70474,2354
> Are you the Jim Butterfield of the C64 days? Yup, and before the C64 days, too… >> .. building a list (based on first character).. > .. I'm not sure it will be faster.. For the sake of argument, let's say that your data is evenly distributed between the 26 letters (VERY unlikely). You would have to do about FIVE comparisons to get to the area of the first letter; and comparisons are usually costly in processing time. Now, let's try the initial letter thing, in quasi-Basic: Index = ASC(UPPER$(string)) – 64 (This should bring index into the range 1 to 26) Startpointer = List(Index) Endpointer = List(Index+1) No comparisons yet, but your list is down to (optimally) 1/26 of its original search size. In practice, you might get 1/10. If you're doing names in Scotland, where a large proportion start with "Mc..", you might need to vary the approach and make a separate list for these. >> .. tree structure > .. I'm trying to find some examples of this .. Tree structure coding is a whole state of mind. These are most useful, I think, when the data is undergoing continuous update; you can slip extra stuff into a tree with much less pain than the regular ordered list. When you start reading up on it, check out a method called "B-trees". This isn't a binary split; each branch on the tree can be a multi-way branch. Quite popular these days. >> .. a "hashing" technique .. > .. anyplace I might look to find an example? .. Looks for books on computer science, or algorithms. Here's a VERY crude example… < continued in next message >