摘要:
/** 分析:题意要求找字符串个数最多的一个* 方法:很多,hash就是其中一种 * 注意两点:1.去掉前导0; 2.每组测试数据后,要释放内存 * 第一点解析:例如数据01,001,0001, 00001不去前导0的话,hash以后映射到不同的表位置 *//* Author: Try86 Date: 09/04/12 18:01*/#include <cstdio>#include <cstring>#include <iostream>using namespace std;const int M = 5471; //hash表大小struct node 阅读全文
posted @ 2012-04-09 18:37
Try86
阅读(560)
评论(0)
推荐(0)
摘要:
//字符串hash练手题,采用拉链式解决冲突 #include <cstdio>#include <cstring>#include <iostream>using namespace std;const int M = 43853;//hash表大小 struct node {//节点 char str1[11]; char str2[11]; node *next; };struct hashTable {//hash表 node *link;}hash[M];char text[3005];char str1[11], str2[11], ch[11] 阅读全文
posted @ 2012-04-09 17:49
Try86
阅读(163)
评论(0)
推荐(0)
浙公网安备 33010602011771号