Professional Documents
Culture Documents
5.20, 2012
4
Method of Four Russians
= MoFR
=
11
Edit Distance
= Levenshtein Distance
= DP matching
uv
(1/2)
twittertuitar3 (*2 + *1)
(2/2)
(i,j)s(i,j)
= s(i, j - 1) + 1
= s(i - 1, j) + 1
= s(i - 1, j - 1) + (1 - (u[i - 1], v[j - 1]))
s(i, j) = min(, , )
n^2
O(1)
O(n^2)
O(log(c) * n^2 / log(n))
c
(1/3)
n^2
t
11
(n/t)^2
O(t)
c(2c)^(2t) * t^2
(2/3)
O((n^2 / t))
(2c)^(2t) * t^2
t = log(n)/2(log(c) + 1)
(2c)^(2t) * t^2
(3/3)
t = log(n)/2(log(c) + 1)
O(n^2 / t) = O(log(c) * n^2 / log(n))
O(n * (log(n) / log(c))^2)
()