{"title":"Linear time online algorithms for constructing linear-size suffix trie","authors":"","doi":"10.1016/j.tcs.2024.114765","DOIUrl":null,"url":null,"abstract":"<div><p>The suffix trees are fundamental data structures for various kinds of string processing. The suffix tree of a text string <em>T</em> of length <em>n</em> has <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> nodes and edges, and the string label of each edge is encoded by a pair of positions in <em>T</em>. Thus, even after the tree is built, the input string <em>T</em> needs to be kept stored and random access to <em>T</em> is still needed. The <em>linear-size suffix tries</em> (<em>LSTs</em>), proposed by Crochemore et al. [Linear-size suffix tries, TCS 638:171-178, 2016], are a “stand-alone” alternative to the suffix trees. Namely, the LST of an input text string <em>T</em> of length <em>n</em> occupies <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> total space, and supports pattern matching and other tasks with the same efficiency as the suffix tree without the need to store the input text string <em>T</em>. Crochemore et al. proposed an <em>offline</em> algorithm which transforms the suffix tree of <em>T</em> into the LST of <em>T</em> in <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mi>log</mi><mo></mo><mi>σ</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> space, where <em>σ</em> is the alphabet size. In this paper, we present two types of <em>online</em> algorithms which “directly” construct the LST, from right to left, and from left to right, without constructing the suffix tree as an intermediate structure. Both algorithms construct the LST incrementally when a new symbol is read, and do not access the previously read symbols. Both of the right-to-left construction algorithm and the left-to-right construction algorithm work in <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mi>log</mi><mo></mo><mi>σ</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> space. The main feature of our algorithms is that the input text string does not need to be stored.</p></div>","PeriodicalId":49438,"journal":{"name":"Theoretical Computer Science","volume":null,"pages":null},"PeriodicalIF":0.9000,"publicationDate":"2024-08-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical Computer Science","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304397524003827","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0
Abstract
The suffix trees are fundamental data structures for various kinds of string processing. The suffix tree of a text string T of length n has nodes and edges, and the string label of each edge is encoded by a pair of positions in T. Thus, even after the tree is built, the input string T needs to be kept stored and random access to T is still needed. The linear-size suffix tries (LSTs), proposed by Crochemore et al. [Linear-size suffix tries, TCS 638:171-178, 2016], are a “stand-alone” alternative to the suffix trees. Namely, the LST of an input text string T of length n occupies total space, and supports pattern matching and other tasks with the same efficiency as the suffix tree without the need to store the input text string T. Crochemore et al. proposed an offline algorithm which transforms the suffix tree of T into the LST of T in time and space, where σ is the alphabet size. In this paper, we present two types of online algorithms which “directly” construct the LST, from right to left, and from left to right, without constructing the suffix tree as an intermediate structure. Both algorithms construct the LST incrementally when a new symbol is read, and do not access the previously read symbols. Both of the right-to-left construction algorithm and the left-to-right construction algorithm work in time and space. The main feature of our algorithms is that the input text string does not need to be stored.
期刊介绍:
Theoretical Computer Science is mathematical and abstract in spirit, but it derives its motivation from practical and everyday computation. Its aim is to understand the nature of computation and, as a consequence of this understanding, provide more efficient methodologies. All papers introducing or studying mathematical, logic and formal concepts and methods are welcome, provided that their motivation is clearly drawn from the field of computing.