摘要: 2个字符串a,b,A:abcdefghi B:abcgi 返回trueA:abcdefghi B:abz 返回false(因为字符串A不包含字母Z)任意语言,但是注意要最优算法,另外,也要处理异常状况。你输入的有可能是乱码,有可能A比B字符串还短,也有可能空字符串,还有如果字符串不是排序而是乱序。//假设str1和str2不是排序的,时间复杂度 str1.Length*str2.Lengthstaticbool M2(string str1, string str2){if (str1 == null || str2 == null || str2.Length == 0 || str1.Le 阅读全文
posted @ 2013-12-27 10:29 purplesun 阅读(153) 评论(0) 推荐(0) 编辑