// Source code example for "A Practical Introduction // to Data Structures and Algorithm Analysis" // by Clifford A. Shaffer, Prentice Hall, 1998. // Copyright 1998 by Clifford A. Shaffer import java.io.*; // Hash test driver class. // Test out some hash functions. public class Hashmain { static long ELFhash(String key, int M) { long h = 0; for (int i=0; i>> 24; h &= ~g; } return h % M; } static int h(String x, int M) { int i, sum; for (sum=0, i=0; i