This commit is contained in:
nonstriater
2014-05-08 15:01:56 +08:00
parent 3954690000
commit 04a7c20142
15 changed files with 847 additions and 57 deletions
+7 -3
View File
@@ -34,8 +34,11 @@ a = a - b;
不开辟用于交换数据的临时空间,如何完成字符串的逆序(在技术一轮面试中,有些面试官会这样问)
用C语言实现一个revert函数,它的功能是将输入的字符串在原串上倒序后返回。
按单词逆序 。如 “this is a sentence。” 逆序就是 “.sentence a is this”
按单词逆序 。如 “this is a sentence。” 逆序就是 “.sentence a is this”
思路:
1. 先按单词逆序,
2. 对1)的结果,对整个句子逆序
判断字符粗是否是回文
@@ -93,6 +96,9 @@ hash表长度 256,字符直接作为key值
BOOL isBrother(const char *first,const char *secd)
思路一: 循环匹配 指数级复杂度
思路二: 利用质数,平方和比较,但这样必须是2个串的长度要一样,需要的空间比较大,最多256个字节
@@ -116,8 +122,6 @@ void statistics(FILE *fd)
char *compress(const char *src,char *dest)
给出一个函数来复制两个字符串A和B。字符串A的后几个字节和字符串B的前几个字节重叠。