《Cracking the Coding Interview》——第17章:普通题——题目9

时间:2014-04-29 16:00:32   收藏:0   阅读:388

2014-04-28 23:52

题目:设计算法,找出一本书中某个单词的出现频率。

解法:数就行了。

代码:

bubuko.com,布布扣
 1 // 17.9 Given a book, find out the occurrences of any given words in it.
 2 // Answer:
 3 //    1. process the book as a text file.
 4 //    2. find all words, definition of a word must be clearly asserted.
 5 //    3. use map or hash table to record the occurrences of words.
 6 //    4. query the statistics for an answer.
 7 int main()
 8 {
 9     return 0;
10 }
bubuko.com,布布扣

 

《Cracking the Coding Interview》——第17章:普通题——题目9,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!