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.
標簽:
the
subsequence
determine
Instead
上傳時間:
2013-12-17
上傳用戶:evil
//--- --- --- - 音樂簡譜播放器--- --- --- -
/*奏樂程序使用說明
調用方式: sing fname [speed [times]]
文件名 速度(拍/分) 遍數
簡譜文件格式:
第1行: 曲名 節拍 調號
第2行-- 樂譜 (空格,換行無意義,但不得插在一個"音描述"內部)
記號:
* 節拍,調號,小節分隔符,終止符,升音符,中音音高,休止符,附點,延長
符等 -- 按照常規.
* 音描述 --
[3連音符][升降還原符]音高[高低音后綴][音長][附點][延長符]
* 3連音符 -- ^ 只標在第1音前,音長只標在第3音后
(3連音的實際總音長為所標音長的兩倍,例如:^323 的總音長為1拍)
* 降音符 -- @
* 還原符 -- $
* 高低音后綴 -- H(高音) U(高16度音) 連用音程相加
L(低音) W(低16度音)
* 音長 -- 無(1拍) (1/2拍) "(1/4拍) 連用為相乘*/
標簽:
fname
speed
times
sing
上傳時間:
2014-11-28
上傳用戶:hj_18