- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
数据结构编程之c语言线性表(Data structure c language programming of linear table)
数据结构编程之c语言线性表(Data structure c language programming of linear table) # includes stdlib.h # includes stdio.h # includes conio.h # includes string.h # define n 100 typedef struct { char str [100]. int len; - stu. stu, lb. initiate (stu * lis) { lis - len = 0; printf (初始化成功 \ n); } int length (); / / 线性表求长度函数 / / char get (); / / 线性表获取函数 / / void locate (); / / 线性表查找函数 / / void insert (); / / 线性表插入函数 / / void (); / / 线性表删除函数 / / void empty (); / / 线性表判空函数 / / void print (); / / 线性表输出函数 / / char menuselect (); / / 目录函数 / / void mergelist (); / / 线性表归并函数 / / int main () / / 主函数 / / (char c, ss. int n; stu, lb, lc. int i = 0; initiate (); printf (请输入一个线性表); scanf (% s, la.str); la.len = strlen (la.str); while (1) { switch (menuselect ()) / / 调用显示主目录函数 / / { houses in. if (the); break; case b: printf (请输入你需插入的字母的位置和字母:); scanf (% d% c, n ss). insert (, n, ss). break; case c: (); break; houses of: empty (). break; case is: print (a); break; f: houses length (a); break; case g: printf (请输入两个有序字母数列:); scanf (% s% s, la.str, lb.str); la.len = strlen (la.str); lb.len = strlen (lb.str); mergelist (la, lb, lc). print (lc); break; houses h: printf (退出系统: \ n); printf (are you sure to quit? (y / n)); getchar (); c = getchar (); if (c = n) break; if (c = = y) exit (0); } system (pause); } return 0; } int length (stu lis) / / 线性表求长度函数 / / { printf (线性表的长度是% d \ n, lis.len); return lis.len; } char get (stu lis, int n) / / 线性表获取函数 / / { if ((n - 1) | | (n lis.len)) {printf (你要找的不合法 \ n); return 0;} else return lis.str [n - 1]. } void locate (stu lis) / / 线性表查找函数 / / {char ss; int i = 0; printf (请输入你需要知道的字母:); getchar (); scanf (% c, ss). for (i = 0; i lis.len; i + +) if (b = = lis.str []) break; if (i lis.len) printf (你要找的字母的下标是:% d \ n, i + 1). else printf (你要找的字母不存在 \ n); return; } void insert (stu * lis, int n, char ss) / / 线性表插入函数 / / { int i = 0; for (i = lis - len; = n; -) lis - str [i] = i - str [- 1]. lis - str [n - 1] = ss; + + + + + + + (i - len); return
您可能关注的文档
- 微博经典语录荟萃,值得珍藏!! (下)(Micro-blog classic quotations, worth collecting!).doc
- 微生物的介绍(Introduction of microorganisms).doc
- 循环答案(Loop answer).doc
- 循环开挖(Cyclic excavation).doc
- 循环系统4(Circulatory system 4).doc
- 微利时代渠道战略突围(Profit age, channel strategy, breakthrough).doc
- 微博经典语录荟萃,值得珍藏!!(上)(Micro-blog classic quotations, worthy of collection!).doc
- 心动的话(Heart stirring words).doc
- 心律失常的临床治疗(Clinical treatment of arrhythmia).doc
- 心悸简析及治疗(Brief analysis and treatment of palpitation).doc
- 数据结构线性表(Data structure linear table).doc
- 数据结构试题及答案3(Data structure, questions and answers 3).doc
- 数据结构顺序线性表的操作(Operation of data structure sequential linear table).doc
- 数据结构顺序线性表(Data structure sequential linear table).doc
- 数据计算机网络知识(Data, computer, network knowledge).doc
- 数据验证(data validation).doc
- 数控机床校准技术在广东先进制造业中的作用(The role of numerical control machine tool calibration technology in Guangdong advanced manufacturing industry).doc
- 数控机床维修技术分析(Maintenance technology analysis of NC machine tools).doc
- 数控维修(NC maintenance).doc
- 数控设备日常维护保养(Daily maintenance of numerical control equipment).doc
文档评论(0)