#include "HashList.h"
typedef struct
{
long pricing_plan_id; //定价计划
long pricing_section_id; //定价段落id
long section_type_id; //定价段落类型
long parent_section_id; //父段落id
long pricing_ref_object_id; //参考对象id
char judge_result[1+1]; //段落起始值
long rum_pricing_strategy_id; //事件度量策略
}PricingSection;
int main(int argc,char * argv[])
{
int i=0;
long l=0;
HashNode ht[HashLength];
PricingSection * pPricSec=NULL;
PricingSection * pPs=NULL;
HashListInit(ht);
for (i=0;i<3*HashLength;i++)
{
pPricSec=(PricingSection*)malloc(sizeof(PricingSection));
if (pPricSec==NULL)
{
printf("\nInsufficient memory available\n");
return -1;
}
pPricSec->pricing_section_id=rand();
HashListInsert(ht, (void*)pPricSec, pPricSec->pricing_section_id);
}
HashListPrint(ht);
while (1)
{
scanf("%d",&l);
if (l==0)
break;
pPs = (PricingSection*)HashListSearch(ht, l);
if(pPs!=NULL)
printf("%ld\n",pPs->pricing_section_id);
HashListDelete(ht, l);
HashListPrint(ht);
}
HashListClear(ht);
getchar();
printf("Clear finish!\n");
getchar();
}
没有合适的资源?快使用搜索试试~ 我知道了~
哈希链表c语言实现,可以直接用来做项目
共2个文件
h:1个
c:1个
5星 · 超过95%的资源 需积分: 50 73 下载量 20 浏览量
2010-08-28
09:11:19
上传
评论 3
收藏 2KB RAR 举报
温馨提示
不用我多说了,常用的一些基本数据结构,可以直接用于项目开发的,便于大家学习交流。
资源推荐
资源详情
资源评论
收起资源包目录
HashList.rar (2个子文件)
HashList
main.c 1KB
HashList.h 4KB
共 2 条
- 1
资源评论
- rilinchen2015-03-17比较简单的实现
- h20088200622014-06-17代码 还可以,思路清晰。
- cstarllxx2013-11-25代码 还可以,思路清晰。
80后老吴
- 粉丝: 12
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功