[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-84581-en":3,"doc-seo-84581-105":29,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},84581,8796095360427,"Lucas Martin","https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d",8,"Research & Report","Online Computation of Maximal Closed Substrings","A non-empty string defines a closed substring by either having length one or having its longest border occur exactly twice. A closed substring occurrence is maximal if it cannot be extended left or right while staying closed. Maximal closed substrings (MCSs) generalize maximal repetitive structures such as runs. The work presents an online computation model where characters are appended one by one, detecting newly formed MCSs after each append.","arXiv :2607 .006 12v 1 [ cs .DS] 1 Jul 2026  \nOnline computation of maximal closed substrings  \nHiroki Shibata 1 , Haruki Umezaki2 , Takuya Mieno3 , Yuto Nakashima4 , and  \nShunsuke Inenaga4  \n1 Joint Graduate School of Mathematics for Innovation, Kyushu University, Japan,  \n[shibata. hiroki.753@s. kyushu-u. ac. jp](shibata. hiroki.753@s. kyushu-u. ac. jp)  \n2 Department of Information Science and Technology, Kyushu University, Japan,  \n[umezaki. haruki.314@s. kyushu-u. ac. jp](umezaki. haruki.314@s. kyushu-u. ac. jp)  \n3 Graduate School of Informatics and Engineering, University of Electro-Communications,  \nJapan, [tmieno@uec. ac. jp](tmieno@uec. ac. jp)  \n4 Department of Informatics, Kyushu University, Japan,  \n{nakashima. yuto.003, [inenaga. shunsuke.380}@m. kyushu-u. ac. jp](inenaga. shunsuke.380}@m. kyushu-u. ac. jp)  \nAbstract  \nA non-empty string is closed if its length is one or its longest border appears exactly twice in the string. An occurrence of a closed substring is a maximal closed substring (MCS) if it cannot be extended to the left or to the right while preserving closedness. MCSs can be regarded as a general class of maximal repetitive structures including runs. In this paper, we study the computation of MCSs of a string given in an online manner, where one character is appended to the string at a time. Our algorithm detects newly formed MCSs after each append operation by using the rightmost previous occurrences of suffixes. To support this efficiently, we introduce the link-cut suffix tree (LCST), a novel data structure combining an online suffix tree with a link-cut tree. The LCST maintains rightmost occurrence information for substrings represented in the suffix tree in O (nlog n) total time and O (n) space, where n is the length of the input string. Using the LCST, we obtain an O(nlog n)-time online algorithm for computing all MCSs, which is worst-case optimal. As further direct applications of the LCST, we obtain online algorithms for rightmost LZ77 factorizations and most recent match queries.  \nKeywords: suffix trees ; dynamic trees ; online string algorithms ; closed words ; maximal closed substrings  \n1 Introduction  \nRepetitions are among the most fundamental structures in strings. Runs, also called maximal repetitions, area central example and have been studied extensively [3,9,10,13,17] . The notion of maximal closed substrings (MCSs) was introduced to capture maximal repetitive structures beyond periodic repetitions [1, 2] . A nonempty string is closed if it has length one or its longest border appears exactly twice. An occurrence of a closed substring is an MCS if it cannot be extended to the left or to the right while preserving closedness. For example, a substring T[1 ..5] = abbab of string T = aabbaba is an MCS of T since abbab is closed (because its border ab occurs exactly twice) and both its left extension T[0 ..5] = aabbab and its right extension T[1 ..6] = abbaba are not closed. By definition, the set of MCSs subsumes the set of runs.  \nThe combinatorics and computation of MCSs have recently become active topics [1,2,12,15] . It is known that the number of MCSs in a string of length n is O (nlog n), and all MCSs can be computed within the same time bound [1, 2] . MCSs have also been studied under the name closed repeats [15] . It is shown in [15] that the maximum numbers of left closed repeats and right closed repeats are both Θ(nlog n), and that a suitable data structure storing all MCSs supports efficient substring queries such as longest substring repeat queries and substring compression queries.  \nIn this paper, we study the online computation of MCSs, where characters are appended one by one to the text. Since the existing offline algorithms compute MCSs using a preconstructed data structure for the  \nentire string, they cannot be applied directly in the online setting. The idea of our online algorithm is as follows: we maintain the rightmost previous occurrences of all suffixes an","cbCaieRjRWhgt0bQ","https://ap.wps.com/l/cbCaieRjRWhgt0bQ","pdf",559222,1,14,"English","en",105,"# Abstract\n# Introduction\n## Background on closed substrings and runs\n## Online computation approach and LCST\n# Preliminaries","[{\"question\":\"What does it mean for a string to be closed in this paper?\",\"answer\":\"A non-empty string is closed if its length is one or its longest border appears exactly twice in the string.\"},{\"question\":\"How is a maximal closed substring (MCS) defined?\",\"answer\":\"An occurrence of a closed substring is an MCS if it cannot be extended to the left or right while preserving closedness.\"},{\"question\":\"What data structure and performance does the online algorithm use?\",\"answer\":\"The algorithm uses the link-cut suffix tree (LCST), which maintains rightmost occurrence information in O(n log n) total time and O(n) space, enabling an O(n log n)-time worst-case optimal online algorithm for all MCSs.\"}]",1784196925,35,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"online-computation-of-maximal-closed-substrings","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/online-computation-of-maximal-closed-substrings/84581/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-17","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What does it mean for a string to be closed in this paper?","Question",{"text":75,"@type":76},"A non-empty string is closed if its length is one or its longest border appears exactly twice in the string.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How is a maximal closed substring (MCS) defined?",{"text":80,"@type":76},"An occurrence of a closed substring is an MCS if it cannot be extended to the left or right while preserving closedness.",{"name":82,"@type":73,"acceptedAnswer":83},"What data structure and performance does the online algorithm use?",{"text":84,"@type":76},"The algorithm uses the link-cut suffix tree (LCST), which maintains rightmost occurrence information in O(n log n) total time and O(n) space, enabling an O(n log n)-time worst-case optimal online algorithm for all MCSs.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":45,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":45,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]