文件名称:xxbgb
介绍说明--下载内容均来自于网络,请自行研究使用
首先,用前插法建立链表,在算法中以create函数表示;其次,定义mergeab函数,表示算法的归并:
本算法的思路为:顺次逐个将单链表的ha中的节点(P节点)在链表 hb中查找是否有重复的结点,若有,则不插入到链表hb中,将其从链表ha中删除。若在链表hb中找到第一个大于P的节点的数据域值的节点(Q节点),则在Q节点之前插入P节点,否则将链表ha联接到链表hb的表尾。为了实现方便在单连表hb之前附加一个表头节点,带归并完成后,再归还该表头节点,返回归并后连表的头指针。
最后,定义main函数,引用之前定义函数完成程序。
-First, the voting method used chain, in the algorithm to create Functions; Secondly, mergeab function definition, the merging algorithm : the idea of this algorithm are : Solve each of the single linked list of nodes ha (P nodes) in the linked list hb whether the search duplicated nodes, if they are not inserted into the chain hb, from its chain ha deleted. If the chain hb find a resolution greater than the P-domain data nodes value of the node (Q nodes), Q node in P insert nodes, or they will Chain link to the chain ha hb end of the table. To achieve even the convenience of the single-table hb an additional table before the first node, with merger, after the completion of the return of the table first node, Even after the return of merging the head table pointer. Finally, the definition o
本算法的思路为:顺次逐个将单链表的ha中的节点(P节点)在链表 hb中查找是否有重复的结点,若有,则不插入到链表hb中,将其从链表ha中删除。若在链表hb中找到第一个大于P的节点的数据域值的节点(Q节点),则在Q节点之前插入P节点,否则将链表ha联接到链表hb的表尾。为了实现方便在单连表hb之前附加一个表头节点,带归并完成后,再归还该表头节点,返回归并后连表的头指针。
最后,定义main函数,引用之前定义函数完成程序。
-First, the voting method used chain, in the algorithm to create Functions; Secondly, mergeab function definition, the merging algorithm : the idea of this algorithm are : Solve each of the single linked list of nodes ha (P nodes) in the linked list hb whether the search duplicated nodes, if they are not inserted into the chain hb, from its chain ha deleted. If the chain hb find a resolution greater than the P-domain data nodes value of the node (Q nodes), Q node in P insert nodes, or they will Chain link to the chain ha hb end of the table. To achieve even the convenience of the single-table hb an additional table before the first node, with merger, after the completion of the return of the table first node, Even after the return of merging the head table pointer. Finally, the definition o
相关搜索: 单链表
(系统自动生成,下载前可以参看下载内容)
下载文件列表
xxbgb.cpp