当前位置: 首页 > news >正文

免费网站奖励自己游戏做个网站怎么做

免费网站奖励自己游戏,做个网站怎么做,现在主流网站用什么做的,宣城建设网站再散列之后散列函数要重新计算。 // kaifangliaobiao.cpp : 定义控制台应用程序的入口点。 //使用平方探测解决冲突问题时#xff0c;散列表至少空一半时#xff0c;总能插入一个新的元素#include stdafx.h #includeiostream using namespace std;#ifnde…         再散列之后散列函数要重新计算。 // kaifangliaobiao.cpp : 定义控制台应用程序的入口点。 //使用平方探测解决冲突问题时散列表至少空一半时总能插入一个新的元素#include stdafx.h #includeiostream using namespace std;#ifndef HashQuad typedef unsigned int Index; typedef Index Position;struct HashTbl; typedef struct HashTbl *HashTable;HashTable InitializeTable(int TableSize); void DestroyTable(HashTable H); Position Find(int key, HashTable H); void Insert(int key, HashTable H); int Retrieve(Position P, HashTable H); HashTable Rehash(HashTable H); #endif // !HashQuad #define MinTableSize 10enum KindOfEntry{Legitimate,Empty,Delete};struct HashEntry {int key;enum KindOfEntry Info; };typedef struct HashEntry Cell;struct HashTbl {int TableSize;Cell *TheCell; };int Hash(int key, int tableSize) {return key%tableSize; }int NextPrime(int n) {if (n % 2 0) n; //1.排除掉偶数for (;; n 2){bool isPrime 1; //2.标志位for (int i 3; i*i n; i 2)if (n%i 0) {isPrime 0;break;}if (isPrime)return n;} }HashTable InitializeTable(int TableSize) //初始化函数 {HashTable H;int i;if (TableSize MinTableSize){cout Table is too small;return NULL;}H (HashTable)malloc(sizeof(HashTbl)); //1.初始化散列表地址if (H NULL)cout out of space;H-TableSize NextPrime(TableSize); //2.用素数初始化散列表大小H-TheCell (Cell *)malloc(sizeof(Cell)*H-TableSize); //3.申请一个表头if (H-TheCell NULL)cout out of space;for (i 0; i H-TableSize; i)H-TheCell[i].Info Empty; //4.为每一个表项赋状态空return H; }Position Find(int key, HashTable H) //用平方探测散列法查找 {Position CurrentPos; //1.要返回的地址int CollisionNum; //2.偏移的位置量CollisionNum 0;CurrentPos Hash(key, H-TableSize);while (H-TheCell[CurrentPos].Info!EmptyH-TheCell[CurrentPos].key!key) //3.检测表项状态{CurrentPos 2 * CollisionNum - 1; //4.偏移if (CurrentPos H-TableSize) //5.满则折返CurrentPos - H-TableSize;}return CurrentPos; }void Insert(int key, HashTable H) {Position Pos;Pos Find(key, H);if (H-TheCell[Pos].Info ! Legitimate){H-TheCell[Pos].Info Legitimate;H-TheCell-key key;} }HashTable Rehash(HashTable H) //再散列 {int i, oldSize;Cell *OldCells;OldCells H-TheCell; //1.记录旧散列表的信息oldSize H-TableSize;H InitializeTable(2 * oldSize); //2.创建两倍大小的新散列表for (i 0; i oldSize; i) { //3.循环复制信息if (OldCells[i].Info Legitimate)Insert(OldCells[i].key, H);}free(OldCells);return H; }int main() {return 0; }     转载于:https://www.cnblogs.com/linear/p/6636876.html
http://www.yutouwan.com/news/469882/

相关文章:

  • 网站备份企业网站开发方案
  • 建设网站 费用吗去哪里找需要推广的app
  • 做网站的赚钱吗设计经典网站
  • 新网域名证书下载湛江网站seo外包
  • wordpress做的著名网站推广链接制作软件
  • 河北外贸网站建设网站建设与运维预算
  • 搜索引擎网站的结构wordpress 老板页
  • 做网站费免图片网站深圳网站建设如何制作
  • 文明网站建设培训体会南山最专业的网站建设
  • 广州致峰网站建设织梦和wordpress
  • 建设网站包维护wordpress rss修改
  • 建一个优化网站多少钱光之翼可以做网站吗
  • 成都装修网站制作价格搭建企业网站公司
  • 受欢迎的模板网站建设网站进入百度观察期
  • 企业网站在百度搜索不到苏州软件开发培训机构
  • 个人简历网站模板下载计算机网络资源网站建设论文
  • 网站建设方案书怎么写网站正在建设页面
  • 市北建筑建网站哪家好自己有服务器和域名怎么做网站
  • 织梦网站模板修改泰兴网站建设价格
  • 万域网站建设保定八大平台公司
  • 重庆旅游网站建设地址平面广告设计图片素材
  • 网站建设 科技公司外贸网站联系方式模板免费
  • 如何把网站扒下来常熟专业做网站
  • 网站开发书的案例电脑网站有哪些
  • 合肥自助建站网站好坏的标准
  • seo整站优化外包哪家好商品展示型网站有哪些
  • 海尔网站建设策划书网络优化工程师工资一般多少
  • 海南省建设网站首页台州市城市建设规划局网站
  • 商城网站主机wordpress如何实现支付功
  • 梅陇做网站广州制作外贸网站