A Space-Efficient Algorithm for Longest Common Almost Increasing Subsequence of Two Sequences
Abstract
Let A and B be two number sequences of length n and m, respectively, where m n. Given a positive number δ, a common almost increasing sequence s1… sk is a common subsequence for both A and B such that for all 2 i k, si+δ > 1 j < i sj. The LCaIS problem seeks to find the longest common almost increasing subsequence (LCaIS) of A and B. An LCaIS can be computed in O(nm) time and O(nm) space [Ta, Shieh, Lu (TCS 2021)], where is the length of the LCaIS of A and B. In this paper we first give an O(nm)-time and O(n+m)-space algorithm to find LCaIS, which improves the space complexity. We then design an O((n+m) n +M M + C)-time and O(M(+ M))-space algorithm, which is faster when the number of matching pairs M and the number of compatible matching pairs C are in o(nm/ m).
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.