- 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双向轮回链表代码(建立、排序、拔出、删除)(国外英文资料)
C++双向循环链表代码(建立、排序、插入、删除)(国外英文资料)
/ *
Write a complete program to implement the basic operation of a two-way loop linked list
(1) a bi-directional circular list is established using the method of tail-interpolation.
(2) iterating through the bi-directional loop list.
(3) to remove a specified element in the two-way loop linked list.
(4) the insertion element e is still an orderly algorithm in the non-decreasing order two-way loop linked list.
(5) to determine whether the element in a bi-directional circular chain is symmetric if it returns 1, otherwise it returns 0.
(6) set the element to be positive integer, and the implementation algorithm will arrange all the odd Numbers before even.
(7) design a simple menu to debug the above algorithm in the main function.
* /
# include stdio, h
# include stdlib. H
Typedef int elemtype;
Typedef struct DuLNode / / define node type
{
Elemtype data;
The prior struct DuLNode *;
Struct DuLNode * next;
} DuLNode, * Dulinklist;
Int initlist (Dulinklist L) / / initialize a two-way list
{
(Dulinklist). / / header attachment
If (! L) exit (-2);
L - data = 0;
L - next = L;
L - the prior = L;
Return 1;
} / / initialize an empty table
Void createlist (Dulinklist l) / / caudal method generates a bi-directional list
{
Dulinklist p, t;
T = L;
Printf ( in the tail method: enter a two-way list node value to end with input 0. \ n );
Scanf ( % d , t- data);
While (t - data! = 0)
{
(Dulinklist) malloc (DuLNode);
If (! P) exit (-2);
T - next = p;
P - the prior = t;
Scanf ( % d , p - data);
T = p;
}
So L minus prior = t minus prior;
The t- prior- next = L;
}
Void shuchulist Dulinklist (L)
/ / the information in the linked list through the chain table
{
Int I;
Dulinklist p;
Printf ( bi-directional linked list is: );
For (p = L, I = 1; p- next! = L; p = p- next)
{
Printf ( % d , p- data);
I++;
}
Printf ( % d \ n , p- data);
Printf ( the length of the bi-directional chain is % d \ n \ n , I);
}
Dulinklist GetElem (Dulinklist L, int x)
/ /
您可能关注的文档
- 3 空间数据的处理 北京大学.ppt
- 2013继承教导岩土试题(国外英文资料).doc
- 2014年12月份测验混凝土结构基础道理第二次功课(国外英文资料).doc
- 2014 吉大《土质学与土力学》在线功课二及谜底(国外英文资料).doc
- 2013涟钢外协工招聘钳工试卷_-_谜底(国外英文资料).doc
- 2013钢筋混凝土试题1谜底(国外英文资料).doc
- 2014年9月份测验施工组织与治理第三次功课(国外英文资料).doc
- 2014年9月份测验桥梁工程第三次功课(国外英文资料).doc
- 2014年9月份测验桥梁工程第二次功课(国外英文资料).doc
- 2014年9月份测验钢结构第一次功课(国外英文资料).doc
文档评论(0)