字符串编辑距离

xiaoxiao2021-02-28  94

举例如下:

 j = 0

f

a

i

l

i

n

g

i = 0

0

1

2

3

4

5

6

7

s

1

1

2

3

4

5

6

7

a

2

2

1

2

3

4

5

6

i

3

3

2

1

2

3

4

5

l

4

4

3

2

1

2

3

4

n

5

5

4

3

2

2

2

3

S = sailn T = failing首先定义这样一个数组——dp[i][j],它表示第一个字符串的长度为i的子串到第二个字符串的长度为j的子串的编辑距离。

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script> 阅读(281) | 评论(0) | 转发(0) | 0

上一篇:腾讯笔试题一道(max宏定义,不使用大于,小于,if语句)

下一篇:虚函数的实现机制

相关热门文章 test123编写安全代码——小心有符号数...使用openssl api进行加密解密...一段自己打印自己的c程序...彻底搞定C语言指针详解-完整版... 给主人留下些什么吧!~~ 评论热议
转载请注明原文地址: https://www.6miu.com/read-56457.html

最新回复(0)