// Copyright(c) 2006, Shinichi Morishita. All Rights Reserved. public class Chapter3_LookupTables { public static int[] buildDirectAddressTable( int[] intTarget, int queryLen ){ // Assume that the elements in intTarget are sorted. int directTableLen = 1; // directTableLen is the queryLen-th power of 4. for(int i=0; i= tableLen. if(intTarget[i] < tableLen) frequency[intTarget[i]]++; else return; int[] cumulation = frequency; // Reuse the frequency table space. for(int i=1; i