- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
线性表的初始化(Initialization of a linear table)
线性表的初始化(Initialization of a linear table) # includes stdio.h # includes stdlib.h # includes malloc.h / malloc (), (), () alloc realloc 等 # includes ctype.h # includes process.h / / exit (n) # includes time.h # define elemtype int / / 数据元素的类型 # define true 1 # define false 0 # define okay 1 # define error 0 # define infeasible - 1 # define overflow - 2 # define list _ init _ size 100 / / 线性表存储空间的初始分配量 # define listincrement 10 / / 线性表存储空间的分配增量 typedef int status; / / status是函数的类型, 其值是函数结果状态代码, 如ok等 typedef int boolean; / / boolean是布尔类型, 其值是true或false typedef struct { elemtype * elem; / / 存储空间基址 int length; / / 当前长度 int listsize; / / 当前分配的存储容量 (以sizeof (elemtype) 为单位) } sqlist; / / -------------------------------------------------------------------------------------------------- void main () {printf (\ n \ n \ t \ t \ t数据结构 (实验一)); status initlist (sqlist l); status initlist1 (sqlist l1). / / 1) 初始化顺序表 sqlist l; if (initlist (l)) printf (\ n (一) 顺序表初始化成功! \ n \ n); else printf ((一) 顺序表初始化失败! \ n \ n); / / 2) 创建一个包含15个不大于100的正整数值的线性表 (15个值由计算机随机产生) int i, j; sqlist l1. initlist1 (l1). printf ((二) 随机产生的15个不大于100的正整数值: \ n); void p (sqlist l); p (l1). printf (\ n \ n); / / 3) 将一个数插在第i个元素前 printf ((三) 将一个数插在第i个元素前 \ n \ n); the status listinsert _ (sqlist l1, int i, int); int and. printf (请输入要插入的元素:); scanf (% d, c). printf (\ n要插在第几个元素前:); scanf (% d the); while ( 1 | | 15) { printf (\ n要重新插在第几个元素前:); scanf (% d the); } the listinsert _ (l1,, and). printf (\ n插入成功 \ n); p (l1). printf (\ n \ n); / / 4) 删除第i个元素 printf ((四) 删除第i个元素 \ n \ n); the status listdelete _ (sqlist l1, int i, int e); printf (请输入要删除的元素位置:); scanf (% d, j). the listdelete _ (l1, j,); printf (\ n删除成功 \ n); / / 4) 输出线性表中的所有元素 p (l1). printf (\ n \ n); } / / 主函数 / / -------------------------------------------------------------------------------------------------- status initlist (sqlist l) { / / 构造一个空的线性表l. l.elem = (elemtype *) malloc (list _ init _ size * sizeof (elemtype)); if
您可能关注的文档
- 汽车维护保养大全-专家把脉汽车冷故障(Car maintenance Daquan - car experts feel the pulse of cold fault).doc
- 汽车维修发展(Automobile maintenance development).doc
- 汽车维修技术(Automobile maintenance technology).doc
- 汽车美容铺创业计划书(Business plan for car beauty shop).doc
- 汽车维修(Automobile maintenance).doc
- 汽车考试理论秘籍(Automobile test theory cheats).doc
- 汽车蓄电池的日常使用和养护方法(Daily usage and maintenance methods of automotive batteries).doc
- 汽车营销新模式(New model of automobile marketing).doc
- 汽车音响扫盲(Car audio literacy).doc
- 汽轮机调速系统检修工(Overhauling engineer of steam turbine speed regulation system).doc
- 线性表的动态顺序存储实现(Implementation of dynamic sequential storage of linear table).doc
- 线性表链接存储(单链表)操作的16种算(Linear table link storage (single table) 16 kinds of arithmetic operations).doc
- 线性规划求解程序(Linear programming solver).doc
- 线性链表的显示,插入,删除,清空(Linear list display, insert, delete, empty).doc
- 线性顺序表的显示,插入,删除(Linear sequential table display, insert, delete).doc
- 线材与音质(Wire and sound quality).doc
- 线的基本知识(Basic knowledge of line).doc
- 线程、线程句柄、线程id的关系(Thread, thread handle, thread ID relationship).doc
- 线性代数难点解析(Analysis of difficulties in linear algebra).doc
- 线路板布线规则(Circuit board wiring rule).doc
有哪些信誉好的足球投注网站
文档评论(0)