pip install tust-py-tools-d
计算 word1
到 word2
的编辑距离
时间复杂度:
空间复杂度:
计算字符串相似度
时间复杂度:
空间复杂度:
Attributes:
- first(str): 字符1
- second(str): 字符2
- ratio:float: 相似度
批量匹配两个列表的内字符的相似度
此方法会将将两个数组做一次笛卡尔乘积运算
时间复杂度: m=first_workds.length
,n=second_words.length
.$O(mn(a+b))$.a,b为列表包含字符串的平均长度
空间复杂度:
计算在source
序列中,子序列target
出现的次数
时间复杂度: m
为source
的长度,n
为target
的长度
空间复杂度: m
的数组来记录状态值