Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread john gilmore
corrected text: Worth trying first is von Neumann's classical scheme. Divide the value obtained using the z/Architecture machine instruction CKSUM. Then use its remainder mod(s), where s is any convenient small prime. The result will often be an approximately rectangular distribution of

Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread john gilmore
Three responses: Yes, 61, which is prime, is better than 64 = 2^6, which is composite. A binary search/chop is easy when one has all of the values one is going to search for compresent and available to be put into a table. When one is acquiring these values serially in time, a

Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread Gerhard Postpischil
On 7/27/2010 6:06 PM, john gilmore wrote: into a table. When one is acquiring these values serially in time, a binary-search tree can be used instead; but it must be kept balanced/compact; and this is a non-trivial undertaking. It depends on one's perception of trivial. Volume 3 of Knuth's

Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread Rick Fochtman
---snip--- It depends on one's perception of trivial. Volume 3 of Knuth's Art of Computer Programming has a very simple algorithm for building balanced trees. ---unsnip-- I

Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread Gerhard Postpischil
On 7/27/2010 8:42 PM, Rick Fochtman wrote: I can tell you from bitter experience that while the algorithm is fairly simple, implementation is most assuredly NOT simple. :-( About twelve years ago I was working as a contractor at a government agency that routinely processed files with hundreds

Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread Rick Fochtman
---snip-- On 7/27/2010 8:42 PM, Rick Fochtman wrote: I can tell you from bitter experience that while the algorithm is fairly simple, implementation is most assuredly NOT simple. :-( About twelve years ago I was working as a

Re: Hashin g algorith m for text strings w ithout emb edded blan ks‏

2010-07-27 Thread David Crayford
Rick Fochtman wrote: ---snip--- It depends on one's perception of trivial. Volume 3 of Knuth's Art of Computer Programming has a very simple algorithm for building balanced trees.