A pattern matching algorithm in binary trees
An algorithm is presented which searches all occurrences of a given complete binary tree in another, in running time proportional to the sum of the numbers of their nodes. The algorithm is essentially an application of Knuth-Morris-Pratt's string matching algorithm. An extension to more general tree structures is also described.
Unable to display preview. Download preview PDF.
- Donald E. Knuth, Fundamental Algorithm, The art of Computer Programming, Vol.1, Addison-Wesley, Reading,Mass., 1968; 2nd edition 1973.Google Scholar
- Malcom C. Harrison, Implementation of the substring test by hashing, Comm.ACM, 14 (1971), pp 777–779.Google Scholar
- D.E. Knuth, J.H. Morris, Jr., V.R. Pratt, Fast Pattern Matching in Strings, SIAM J. of Computer, Vol.6, No.2, June 1977, pp.323–350.Google Scholar
- Alfred.V. Aho and Margaret J. Corasick, Efficient string matching: An aid to bibliographic search, Comm.ACM, 18 (1975), pp.333–340.Google Scholar
- R.S. Boyer and J.S. Moore, A fast string searching algorithm, Comm.ACM, Vol.20, No.2, Oct. 1977.Google Scholar
- C.M. Hoffmann and M.J. O'donnell, Pattern Matching in Trees, Journal of ACM, Vol.29, No.1, January 1982, pp.68–95.Google Scholar
- K.Kojima, A linear tree matching algorithm, Master Thesis, Kyoto University.Google Scholar