摘要: 某同学的同学摩根电面的一道题目:有一个大的textfile,里面很多英文单词,查找重复出现的单词;题目的简单:全部遍历太慢,考官说太慢,为什么不使用stl的map实现呢?如果不是单词呢?如果是url呢?为什么不使用hash_map呢?Good!如果还是单词,能不能再快点呢?能,使用强大的Trie吧!使用stl的map实现:#pragma warning(disable : 4786)#include <iostream>#include <string>#include <map>using namespace std;int main(){ map< 阅读全文
posted @ 2013-04-05 13:42 legendmaner 阅读(414) 评论(0) 推荐(0)