Longest Unbordered Factors in Linear Time
Takuya Mieno
Abstract
A border of a string is a nonempty proper prefix that is also a suffix. A string is unbordered if it has no border. The length of a longest unbordered factor is closely related to the smallest period of the string. While the smallest period can be computed in linear time, the best previously known algorithm for computing a longest unbordered factor takes O(n n) worst-case time for a string of length n. Whether this computational problem can be solved in worst-case linear time has remained open. In this paper, we resolve this open problem for integer alphabets of size nO(1) by presenting an algorithm that computes all occurrences of longest unbordered factors in O(n) worst-case time. Our algorithm uses a combinatorial property of longest unbordered factors and scans the input string in both directions to capture all occurrences achieving the global maximum without computing the local maximum at every starting position.
Create a lesson
Related papers
LinearKnot: Linear-Time Approximation of the Pseudoknot Partition Function
Shared title terminology · Milan Gautam, David H. Mathews, Liang Huang
Strong Backdoor to Forests is FPT: Tight Linear-Time FPT for Essentially General SAT
Shared title terminology · Olesia Bilyk, Aidar Munduzbaev, Roohani Sharma et al.
Load Balancing with Item Fragmentation and More Bins than Items: Linear-Time and Exact
Shared title terminology · Ben Bals, Tomáš Flouri, Kassian Kobert et al.
Canonical Cut Hierarchy in Almost-Linear Time via Reduction to Max-Flow
Shared title terminology · Karthekeyan Chandrasekaran, Harshul Sagar
Solving Linear Programs in the Matrix Multiplication Time
Shared title terminology · Zhao Song
Polynomial-Time Differentially Private Synthetic Graph Release with Nearly-Linear Additive Error
Shared title terminology · Marek Eliáš, Gautam Kamath, Janardhan Kulkarni et al.