This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
An Efficient Digital Search Algorithm by Using a Double-Array Structure
September 1989 (vol. 15 no. 9)
pp. 1066-1077

An efficient digital search algorithm that is based on an internal array structure called a double array, which combines the fast access of a matrix form with the compactness of a list form, is presented. Each arc of a digital search tree, called a DS-tree, can be computed from the double array in 0(1) time; that is to say, the worst-case time complexity for retrieving a key becomes 0(k) for the length k of that key. The double array is modified to make the size compact while maintaining fast access, and algorithms for retrieval, insertion, and deletion are presented. If the size of the double array is n+cm, where n is the number of nodes of the DS-tree, m is the number of input symbols, and c is a constant particular to each double array, then it is theoretically proved that the worst-case times of deletion and insertion are proportional to cm and cm/sup 2/, respectively, and are independent of n. Experimental results of building the double array incrementally for various sets of keys show that c has an extremely small value, ranging from 0.17 to 1.13.

[1] A. V. Aho and M. J. Corasick, "Efficient string matching: An aid to bibliographic search,"Commun. ACM, pp. 333-340, June 1975.
[2] A. Aho, J. Hopcroft, and J. Ullman,Data Structures and Algorithms. Reading, MA: Addison-Wesley, 1983.
[3] A. V. Aho, R. Sethi, and J. D. Ullman,Compilers: Principles, Techniques, and Tools. Reading, MA: Addison-Wesley, 1986.
[4] J. Aoe, Y. Yamamoto, and R. Shimada, "An efficient method for storing and retrieving finite state machines" (in Japanese),IECE Trans., vol. J65-D, pp. 1235-1242, Oct. 1982; (in English),Electronica Japonica, vol. 13.
[5] J. Aoe, Y. Yamamoto, and R. Shimada, "A practical method for reducing sparse matrices with invariant entries,"Int. J. Comput. Math., vol. 12, pp. 97-111, Nov. 1982.
[6] J. Aoe, Y. Yamamoto, and R. Shimada, "A method for reducing weak precedence parsers,"IEEE Trans. Software Eng., vol. SE-10, pp. 25-30, Jan. 1983.
[7] J. Aoe, Y. Yamamoto, and R. Shimada, "An efficient method for storing and retrieving pattern matching machines" (in Japanese),Trans. IPS Japan, vol. 24, pp. 414-420, July 1983.
[8] J. Aoe, Y. Yamamoto, and R. Shimada, "A method for improving string pattern matching machines,"IEEE Trans. Software Eng., vol. SE-10, pp. 116-120, Jan. 1984.
[9] J. Aoe, Y. Yamamoto, and R. Shimada, "An efficient algorithm of reducing sparse matrices by row displacements" (in Japanese),Trans. IPS Japan, vol. 26, pp. 211-218, Mar. 1985.
[10] J. Aoe, Y. Yamamoto, and R. Shimada, "An efficient implementation of static string pattern matching machines," inProc. First Int. Conf. Supercomputing, Dec. 1985, pp. 491-498; also inIEEE Trans. Software Eng., vol. 15, pp. 1010-1016, Aug. 1989.
[11] J. Aoe, "An efficient implementation of finite state machines using a double-array structure" (in Japanese),IECE Trans., vol. J70-D, pp. 653-662, Apr. 1987.
[12] J. Aoe and M. Fujikawa, "An efficient representation of hierarchical semantic primitives--An aid to machine translation systems," inProc. Second Int. Conf. Supercomputing, May 1987, pp. 361-370.
[13] J. Aoe, S. Yasutome, and T. Sato, "An efficient digital search algorithm by using a double-array structure," inProc. Twelfth Int. Computer Software and Applications Conf., Oct. 1988, pp. 472-479.
[14] F. Berman, M. E. Bock, E. Dittert, M. J. O'Donnell, and D. Plank, "Collections of functions for perfect hashing,"SIAM J. Comput., vol. 15, no. 2, pp. 604-618, May 1986.
[15] R. Cichelli, "Minimal Perfect Hash Functions Made Simple,"Comm. ACM, Vol. 23, No. 1, Jan. 1980, pp. 17-19.
[16] G. V. Cormack, R. N. S. Horspool, and M. Kaiserswerth," Practical perfect hashing,"Comput. J., vol. 28, pp. 54-58, Jan. 1985.
[17] S. C. Johnson, "YACC--Yet another compiler-compiler," Bell Lab., NJ, Comput. Sci. Tech. Rep. 32, pp. 1-34, 1975.
[18] G. Jaeschke, "Reciprocal Hashing: A Method for Generating Minimal Perfect Hashing Functions,"Comm. ACM, Vol. 24, No. 12, Dec. 1981, pp. 829-833.
[19] W. D. Jonge, A. S. Tanenbaum, and R. P. Reit, "Two access methods using compact binary trees,"IEEE Trans. Software Eng., vol. SE-13, pp. 799-810, July 1987.
[20] R. Fagan et al., "Extendible Hashing--A Fast-Access Method for Dynamic Files,"ACM Trans. Database Systems, Vol. 4, No. 3, Sept. 1979, pp. 315-344.
[21] E. Fredkin, "Trie memory,"CACM, vol. 3, pp. 490-499.
[22] M. L. Fredman and J. Komlos, "Storing a sparse table with O(1) worst case access time,"J. Ass. Comput. Mach., vol. 1, no. 3, pp. 538-544, July 1984.
[23] D. E. Knuth,The Art of Computer Programming. Reading, MA: Addison-Wesley, 1973.
[24] M. E. Lesk, "Lex--A lexical analyzer generator," Bell Lab. NJ, Comput. Sci. Tech. Rep. 39, pp. 1-13, Oct. 1975.
[25] K. Maly, "Compressed tries,"Commun. ACM, vol. 19, no. 7, pp. 409-415, July 1976.
[26] J. L. Peterson, "Computer programs for spelling correction: An experiment in program design," inLecture Notes in Computer Science 96. New York: Springer-Verlag, 1980.
[27] B. A. Shell, "Median split trees: A fast lookup technique for frequently occurring keys,"Commun. ACM, vol. 21, pp. 947-958, 1978.
[28] R. Sprugnoli, "Perfect Hashing Functions: A Single Probe Retrieving Method for Static Sets,"Comm. ACM, Vol. 20, No. 11, Nov. 1977, pp. 841-850.
[29] R. E. Tarjan and A. C. Yao, "Storing a sparse table,"Commun. ACM, vol. 22, pp. 606-611, Nov. 1979.
[30] T. A. Standish,Data Structure Techniques. Reading MA: Addison-Wesley, 1980.

Index Terms:
digital search algorithm; double-array structure; internal array structure; matrix form; list form; arc; digital search tree; DS-tree; worst-case time complexity; key; retrieval; insertion; deletion; nodes; input symbols; constant; computational complexity; data structures; search problems; trees (mathematics)
Citation:
J.-I. Aoe, "An Efficient Digital Search Algorithm by Using a Double-Array Structure," IEEE Transactions on Software Engineering, vol. 15, no. 9, pp. 1066-1077, Sept. 1989, doi:10.1109/32.31365
Usage of this product signifies your acceptance of the Terms of Use.