C++版
#include
#include
#include
using namespace std;
//算法
int ldistance(const string source,const string target)
{
//step 1
int n=source.length();
int m=target.length();
if (m==0) return n;
if (n==0) return m;
//Construct a matrix
typedef vector< vector > Tmatrix;
Tmatrix matrix(n+1);
for(int i=0; i<=n; i++) matrix[i].resize(m+1);
//step 2 Initialize
for(int i=1;i<=n;i++) matrix[i][0]=i;
for(int i=1;i<=m;i++) matrix[0][i]=i;
//step 3
for(int i=1;i<=n;i++)
{
const char si=source[i-1];
//step 4
for(int j=1;j<=m;j++)
{
const char dj=ta
最后
以上就是神勇钢笔最近收集整理的关于mysql字符串相似度_匹配字符串相似度算法(各个语言版本)的全部内容,更多相关mysql字符串相似度_匹配字符串相似度算法(各个语言版本)内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复