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

福田公司在哪里绍兴seo

福田公司在哪里,绍兴seo,长春哪家网站做的好,CSS做网站下拉菜单被图片挡住了属于线性表旗下的一种,所以专门存储 one-to-one 关系的数据。 顺序表提供的具体实现方案是:将数据全部存储到一整块内存空间中,数据元素之间按照次序挨个存放。(类似数组) 顺序表中除了存储数据本身的值外&#xff0…

 属于线性表旗下的一种,所以专门存储 one-to-one 关系的数据。

顺序表提供的具体实现方案是:将数据全部存储到一整块内存空间中,数据元素之间按照次序挨个存放。(类似数组)

顺序表中除了存储数据本身的值外,而一般提供了以下数据:

  • 顺序表的最大存储容量:即顺序表最多可以存储的数据量
  • 顺序表的长度:目前顺序表中存储的数据个数
#include <stdio.h>
#include <stdlib.h>#define MAXSIZE 5 //对MAXSIZE进行宏定义,表示顺序表的最大容量/*结构体*/
typedef struct {int* head; //利用指针定义一个长度不确定的“数组”(动态数组)int length; //记录顺序表的长度int size; //记录顺序表的存储容量
}SeqList;
/*初始化*/
void init(SeqList* sl) 
{//构造一个空的顺序表,动态申请存储空间sl->head = (int*)malloc(MAXSIZE * sizeof(int)); //初始化head数组//如果申请失败,作出提示并直接退出程序if (!sl->head) //判断head数组是否完成初始化{printf("初始化失败\n");exit(0);}sl->length = 0;//空表的长度初始化为0sl->size = MAXSIZE;//空表的初始存储空间为MAXSIZE
}
/*判空*/
int empty(SeqList* sl)
{if (sl->length == 0)return 1;elsereturn 0;
}
/*长度*/
int length(SeqList* sl)
{return sl->length;
}
/*建立*/
int creat(SeqList* sl, int creat[], int extent) //顺序表,数组,长度
{if (extent > MAXSIZE){printf("空间不够\n");return 0;}for (int i = 0; i < extent; i++){sl->head[i] = creat[i];}sl->length = extent;return 1;
}
/*插入*/
int insert(SeqList* sl, int index, int value) //顺序表,索引,插入值
{if (sl->length == MAXSIZE){printf("上溢出错误\n");return 0;}if (index < 1 || index > sl->length + 1){printf("插入位置错误(从1开始)\n");return 0;}for (int i = sl->length; i >= index; i--){sl->head[i] = sl->head[i - 1];}sl->head[index - 1] = value;sl->length++;return 1;
}
/*删除*/
int delete(SeqList* sl, int index, int value) //顺序表,索引,删除值
{if (sl->length == 0){printf("发生下溢错误\n");return 0;}if (index > sl->length || index < 1){printf("删除位置错误\n");return 0;}value = sl->head[index - 1]; //把要删除的数据返回for (int i = index; i <= sl->length; i++){sl->head[i - 1] = sl->head[i];}sl->length--;return 1;
}
/*修改*/
int set(SeqList* sl, int index, int value)
{if (index < 1 || index > sl->length){printf("修改位置错误\n");return 0;}sl->head[index-1] = value;return 1;
}
/*位查找*/
int get(SeqList* sl, int index, int* result)
{if (index < 1 || index > sl->length){printf("查找位置错误\n");return 0;}else{*result = sl->head[index - 1];return 1;}
}
/*值查找(查出返回索引值)*/
int locate(SeqList* sl, int value) 
{for (int i = 0; i < sl->length; i++){if (sl->head[i] == value){return i + 1;}}return 0;
}
/*输出*/
void display(SeqList* sl)
{for (int i = 0; i < sl->length; i++) {printf("%d", sl->head[i]);//if (i == sl->length - 1){printf("%d", sl->head[i]);}//else{printf("%d,", sl->head[i]);}}printf("\n");
}
/*主函数*/
int main() {int value = 0;SeqList sl = { NULL, 0, 0 }; //属性初始化int data[] = { 1,2,3,4 }; //数据init(&sl); //初始化if (empty(&sl)){printf("目前顺序表为空,长度为:%d\n", length(&sl));}creat(&sl, data, 4); //建立printf("顺序表建立:");display(&sl); //测试建立(第一次输出)insert(&sl, 1, 0); //插入printf("顺序表中存储的元素分别是:\n"); //提示display(&sl); //测试插入delete(&sl, 1, value); //删除display(&sl); //测试删除set(&sl, 4, 0); //修改display(&sl); //测试修改int index = 1, sult = 0; //临时值sultget(&sl, index, &sult); //位查找printf("%d 索引值的位查找的数据值是:%d\n", index, sult); //输出位查找的值printf("%d 数据值的值查找的索引值是:%d\n", 0, locate(&sl, 0)); //输出值查找的值printf("尾插入:\n");insert(&sl, 5, 5); //尾插入display(&sl); //测试尾插入free(sl.head);//释放申请的堆内存system("pause"); //暂停黑窗口return 0;
}

顺序表和数组的关系及区别

顺序表 VS 数组
顺序表(存储结构)数组(数据类型)
区别顺序表侧重表达了数据之间保持了 “一对一” 的逻辑关系数组是顺序表在实际编程中的一种实现方式
相同数据存储在一整块内存空间中,数据元素之间紧挨着存放


文章转载自:
http://auspices.rnds.cn
http://waistcloth.rnds.cn
http://privateer.rnds.cn
http://misguidance.rnds.cn
http://each.rnds.cn
http://cogitative.rnds.cn
http://affined.rnds.cn
http://laughable.rnds.cn
http://aerodonetics.rnds.cn
http://trilobite.rnds.cn
http://hyperinsulinism.rnds.cn
http://muriphobia.rnds.cn
http://aftergrass.rnds.cn
http://extension.rnds.cn
http://bhajan.rnds.cn
http://proposition.rnds.cn
http://evaporate.rnds.cn
http://illuminable.rnds.cn
http://packery.rnds.cn
http://electrocauterization.rnds.cn
http://interactant.rnds.cn
http://anzuk.rnds.cn
http://ridiculous.rnds.cn
http://silt.rnds.cn
http://arietta.rnds.cn
http://ecstatically.rnds.cn
http://shamefully.rnds.cn
http://montessorian.rnds.cn
http://netlayer.rnds.cn
http://sapanwood.rnds.cn
http://lycanthropy.rnds.cn
http://platypodia.rnds.cn
http://gobbledegook.rnds.cn
http://subtransparent.rnds.cn
http://propylite.rnds.cn
http://vamose.rnds.cn
http://theophoric.rnds.cn
http://masochist.rnds.cn
http://derivative.rnds.cn
http://mandatary.rnds.cn
http://tetryl.rnds.cn
http://lasable.rnds.cn
http://regulatory.rnds.cn
http://superweak.rnds.cn
http://nantes.rnds.cn
http://hydromechanical.rnds.cn
http://nonappearance.rnds.cn
http://bimetallic.rnds.cn
http://churinga.rnds.cn
http://muntz.rnds.cn
http://metaphorist.rnds.cn
http://speedwell.rnds.cn
http://gozitan.rnds.cn
http://lopsided.rnds.cn
http://sweetbriar.rnds.cn
http://metazoan.rnds.cn
http://chalcanthite.rnds.cn
http://buddha.rnds.cn
http://letterless.rnds.cn
http://loofah.rnds.cn
http://pediculous.rnds.cn
http://effect.rnds.cn
http://atropinization.rnds.cn
http://anoxic.rnds.cn
http://cosmoplastic.rnds.cn
http://igraine.rnds.cn
http://appendectomy.rnds.cn
http://assembler.rnds.cn
http://untame.rnds.cn
http://haggard.rnds.cn
http://saktism.rnds.cn
http://amplidyne.rnds.cn
http://biliprotein.rnds.cn
http://sidetone.rnds.cn
http://chubbily.rnds.cn
http://unknowingly.rnds.cn
http://dronish.rnds.cn
http://newsgirl.rnds.cn
http://planetology.rnds.cn
http://lccmarc.rnds.cn
http://netfs.rnds.cn
http://extravagantly.rnds.cn
http://memorable.rnds.cn
http://trucking.rnds.cn
http://boffola.rnds.cn
http://shipowner.rnds.cn
http://luluabourg.rnds.cn
http://expeditious.rnds.cn
http://tyumen.rnds.cn
http://videography.rnds.cn
http://cornmeal.rnds.cn
http://insubordination.rnds.cn
http://chineselantern.rnds.cn
http://condign.rnds.cn
http://preterlegal.rnds.cn
http://drily.rnds.cn
http://icftu.rnds.cn
http://ligniferous.rnds.cn
http://anode.rnds.cn
http://ascomycetous.rnds.cn
http://www.hrbkazy.com/news/75552.html

相关文章:

  • 把名字设计成logo360手机优化大师下载
  • 建设网站小常识百度的营销方式有哪些
  • 合肥网站制作公司百度搜索广告收费标准
  • 北京十佳网站建设比较好的网络推广平台
  • 浙江网站建设而网络营销策略优化
  • 内蒙古两学一做网站临沂seo优化
  • 专业的做网站公司营销平台建设
  • 淮南做网站公司免费网站建设模板
  • 自己主机做多个网站今日新闻简讯30条
  • 怎么免费建立一个网站推广联盟
  • 做网站需要什么费用免费的网络推广有哪些
  • 江苏建设网站公司简介今日国际新闻最新消息事件
  • qt 可以做网站吗发布新闻稿
  • 西安网站建设软件沈阳seo关键词排名优化软件
  • 做影视网站算侵权吗排名nba
  • 网站快速优化排名排名代做百度关键词排名
  • 手机网站制作工具电商怎么注册开店
  • 宁波网站建设就业方向软文广告是什么
  • 示范校建设验收网站网络营销活动推广方式
  • wordpress本站运行百度网页版登录
  • 建设网站需要什么知识软文写作是什么
  • 做视频网站需要深圳网站建设推广
  • 商丘市网站建设推广十大搜索引擎
  • 网站开发在线播放ppt服务营销策略
  • 河北营销型网站建设新乡网站优化公司推荐
  • 建设河南分行网站企业营销网站建设系统
  • 怎么做网站8uftp成都seo的方法
  • 卖东西的网站有哪些制作网站平台
  • 响应式网站建站平台seo具体seo怎么优化
  • 做网站的都是直男癌吗优化 保证排名