MANAGING UNBOUNDED-LENGTH KEYS IN COMPARISON-DRIVEN DATA STRUCTURES WITH APPLICATIONS TO ONLINE INDEXING

作者:Amir Amihood*; Franceschini Gianni; Grossi Roberto; Kopelowitz Tsvi; Lewenstein Moshe; Lewenstein Noa
来源:SIAM Journal on Computing, 2014, 43(4): 1396-1416.
DOI:10.1137/110836377

摘要

This paper presents a general technique for optimally transforming any dynamic data structure that operates on atomic and indivisible keys by constant-time comparisons, into a data structure that handles unbounded-length keys whose comparison cost is not a constant. Examples of these keys are strings, multidimensional points, multiple-precision numbers, multikey data (e. g., records), XML paths, URL addresses, etc. The technique is more general than what has been done in previous work as no particular exploitation of the underlying structure is required. The only requirement is that the insertion of a key must identify its predecessor or its successor. Using the proposed technique, online suffix tree construction can be done in worst case time O(log n) per input symbol (as opposed to amortized O(log n) time per symbol, achieved by previously known algorithms). To our knowledge, our algorithm is the first that achieves O(log n) worst case time per input symbol. Searching for a pattern of length m in the resulting suffix tree takes O(min(m log vertical bar Sigma vertical bar, m + log n) + tocc) time, where tocc is the number of occurrences of the pattern. The paper also describes more applications and shows how to obtain alternative methods for dealing with suffix sorting, dynamic lowest common ancestors, and order maintenance. The technical features of the proposed technique for a given data structure D are the following ones. The new data structure D%26apos; is obtained from D by augmenting the latter with an oracle for strings, extending the functionalities of the Dietz-Sleator list for order maintenance [P. F. Dietz and D. D. Sleator, Proceedings of the Nineteenth Annual ACM Symposium on Theory of Computing, ACM, New York, 1987, pp. 365-372; A. Tsakalidis, Acta Inform., 21 (1984), pp. 101-112]. The space complexity of D%26apos; is S(n)+ O(n) memory cells for storing n keys, where S(n) denotes the space complexity of D. Then, each operation involving O(1) keys taken from D%26apos; requires O(T(n)) time, where T(n) denotes the time complexity of the corresponding operation originally supported in D. Each operation involving a key y not stored in D%26apos; takes O(T(n) + vertical bar y vertical bar) time, where vertical bar y vertical bar denotes the length of y. For the special case where the oracle handles suffixes of a string, the achieved insertion time is O(T(n)).

  • 出版日期2014