摘要: Frequency Counting of Words / Top N words in a document.Given N terms, your task is to find the k most frequent terms from given N terms.Input format:First line of input contains N, denoting the number of terms to add.In each of the next N lines, each contains a term.Next line contains k, most frequ 阅读全文
posted @ 2012-09-17 15:25 可乐爱上了雪碧 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 额,拖了好久,都没时间做~一开始想成用数组实现没有看清楚题目啊。链表操作就是要画出来,写的时候细心点,特别是注意之前的变量有没有改变,要加个临时变量来存。链表易于插入,删除。数组是随机访问。把两者结合起来用就更好。 1 #include <iostream> 2 #include <string> 3 4 using namespace std; 5 6 typedef unsigned int UINT; 7 typedef struct SingleNode 8 { 9 SingleNode():next(NULL){} 10 string data;... 阅读全文
posted @ 2012-09-17 09:29 可乐爱上了雪碧 阅读(166) 评论(0) 推荐(0) 编辑