A fast and simple algorithm for computing the longest common subsequence of run-length encoded strings

  • Authors:
  • Hsing-Yen Ann;Chang-Biau Yang;Chiou-Ting Tseng;Chiou-Yi Hor

  • Affiliations:
  • Department of Computer Science and Engineering, National Sun Yat-sen University, Kaohsiung 80424, Taiwan;Department of Computer Science and Engineering, National Sun Yat-sen University, Kaohsiung 80424, Taiwan;Department of Computer Science and Engineering, National Sun Yat-sen University, Kaohsiung 80424, Taiwan;Department of Computer Science and Engineering, National Sun Yat-sen University, Kaohsiung 80424, Taiwan

  • Venue:
  • Information Processing Letters
  • Year:
  • 2008

Quantified Score

Hi-index 0.89

Visualization

Abstract

Let X and Y be two strings of lengths n and m, respectively, and k and l, respectively, be the numbers of runs in their corresponding run-length encoded forms. We propose a simple algorithm for computing the longest common subsequence of two given strings X and Y in O(kl+min{p"1,p"2}) time, where p"1 and p"2 denote the numbers of elements in the bottom and right boundaries of the matched blocks, respectively. It improves the previously known time bound O(min{nl,km}) and outperforms the time bounds O(kllogkl) or O((k+l+q)log(k+l+q)) for some cases, where q denotes the number of matched blocks.