由买买提看人间百态

topics

全部话题 - 话题: dstbegin
(共0页)
s********g
发帖数: 29
1
来自主题: JobHunting版 - 问个字符串距离的问题
就是那个经典的比较两个字符串距离的问题,看两个字符串需要多少步变换才能成为相
同的字符串。我用递归写的,可是死活不对。谁给指点一下问题在哪儿?
这是我的C# code:
public int CalcDistance(string src, int srcBegin, int srcEnd, string
dst, int dstBegin, int dstEnd)
{
if (srcBegin > srcEnd)
{
if (dstBegin > dstEnd)
return 0;
else
return dstEnd - dstBegin + 1;
}
if (dstBegin > dstEnd)
{
if (srcBegin > srcEnd)
... 阅读全帖
(共0页)