Computing a Longest Common Subsequence of two strings when one of them is Run Length Encoded

Main Article Content

Shegufta Bakht Ahsan
Tanaeem M. Moosa
M. Sohel Rahman
Shampa Shahriyar

Abstract

Given two strings, the longest common subsequence (LCS) problem computes a common subsequence that has the maximum length. In this paper, we present new and efficient algorithms for solving the LCS problem for two strings one of which is run length encoded (RLE). We first present an algorithm that runs in O(gN) time, where g is the length of the RLE string and N is the length of uncompressed string. Then based on the ideas of the above algorithm we present another algorithm that runs in O(Rlog(log g)+N) time, where R is the total number of ordered pairs of positions at which the two strings match. Our first algorithm matches the best algorithm in the literature for the same problem. On the other hand, for R < gN/ log(log)g, our second algorithm outperforms the best algorithms in the literature.

Article Details

How to Cite
Ahsan, S. B., Moosa, T. M., Rahman, M. S., & Shahriyar, S. (2011). Computing a Longest Common Subsequence of two strings when one of them is Run Length Encoded. INFOCOMP Journal of Computer Science, 10(3), 48-55. Retrieved from http://infocomp.dcc.ufla.br/index.php/infocomp/article/view/337
Section
Articles