Pagini recente » Diferente pentru algoritmiada-2010/premii intre reviziile 5 si 4 | Diferente pentru blog/square-root-trick intre reviziile 8 si 9
Nu exista diferente intre titluri.
Diferente intre continut:
Given two strings A (n characters) and B (m characters), find their longest common subsequence. (eg. The longest common sub sequence for abcabc and abcbcca is abcbc.)
There is a standard dynamic programming solution:
== code(c) |
best[i][j] = longest common sub sequence for A[0:i] and B[0:j], computed as below:
==
== code(c) |
if A[i] = B[j]:
best[i][j] = 1 + best[i - 1][j - 1]
else:
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.