更新链表题目

This commit is contained in:
nonstriater
2015-12-01 12:51:40 +08:00
parent fc00cc6d08
commit a2d615a9fc
4 changed files with 90 additions and 40 deletions
+10 -2
View File
@@ -10,7 +10,6 @@
* 子串
#### 翻转句子中单词的顺序
题目:输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变。句子中单词以空格符隔开。
@@ -18,7 +17,7 @@
例如输入“I am a student.”,则输出“student. a am I”。
```
char *revert(const char *source,char *dest);
char *revert_by_word(const char *source,char *dest);
```
思路一:反向拷贝
@@ -35,6 +34,15 @@ b = a - b;
a = a - b;
```
最终示例代码:
```
char *revert_by_word(const char *source,char *dest){
}
```
类似的题目还有:
不开辟用于交换数据的临时空间,如何完成字符串的逆序(在技术一轮面试中,有些面试官会这样问)