虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

您现在的位置是:虫虫下载站 > 资源下载 > 其他 > Instead of finding the longest common subsequence, let us try to determine the length of the LCS.

Instead of finding the longest common subsequence, let us try to determine the length of the LCS.

  • 资源大小:2 K
  • 上传时间: 2013-12-17
  • 上传用户:cal04
  • 资源积分:2 下载积分
  • 标      签: the subsequence determine Instead

资 源 简 介

Instead of finding the longest common subsequence, let us try to determine the length of the LCS. 􀂄 Then tracking back to find the LCS. 􀂄 Consider a1a2…am and b1b2…bn. 􀂄 Case 1: am=bn. The LCS must contain am, we have to find the LCS of a1a2…am-1 and b1b2…bn-1. 􀂄 Case 2: am≠bn. Wehave to find the LCS of a1a2…am-1 and b1b2…bn, and a1a2…am and b b b b1b2…bn-1 Let A = a1 a2 … am and B = b1 b2 … bn 􀂄 Let Li j denote the length of the longest i,g g common subsequence of a1 a2 … ai and b1 b2 … bj. 􀂄 Li,j = Li-1,j-1 + 1 if ai=bj max{ L L } a≠b i-1,j, i,j-1 if ai≠j L0,0 = L0,j = Li,0 = 0 for 1≤i≤m, 1≤j≤n.

相 关 资 源

您 可 能 感 兴 趣 的