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

南京网站建设 雷仁网开发系统 平台

南京网站建设 雷仁网,开发系统 平台,开发个网站开票名称是什么意思,企业品牌网站建设实现功能BuySListNode ————————————申请一个新节点并赋值SListLength —————————————计算链表的长度SListPushBack————————————尾插SListPushFront————————————头插SListPopBack—————————————尾删SListPopFront—…实现功能BuySListNode ————————————申请一个新节点并赋值SListLength —————————————计算链表的长度SListPushBack————————————尾插SListPushFront————————————头插SListPopBack—————————————尾删SListPopFront————————————头删SListFindByVal————————————按值查找链表SListFindByPos————————————按位置查找链表SListInsertAfter————————————任意位置插入SListEraseAfter————————————任意位置删除SListPrint——————————————打印链表SList.h#pragma once#define _CRT_SECURE_NO_WARNINGS 1#include stdio.h #include stdlib.h #include stdbool.htypedef int SLTDataType;typedef struct SLTNode {SLTDataType data;struct SLTNode* next; }SLTNode;//申请一个新节点并赋值 extern SLTNode* BuySListNode(SLTDataType x);//计算链表的长度 extern int SListLength(SLTNode* phead);//尾插 extern void SListPushBack(SLTNode** pphead, SLTDataType x);//头插 extern void SListPushFront(SLTNode** pphead, SLTDataType x);//尾删 extern void SListPopBack(SLTNode** pphead);//头删 extern void SListPopFront(SLTNode** pphead);//按值查找链表 extern SLTNode* FindByVal(SLTNode* phead, SLTDataType x); extern void SListFindByVal(SLTNode* phead, SLTDataType x);//按位置查找链表 void FindByPos(SLTNode* phead, int pos, SLTNode** pp_aim1, int* p_aim2); extern void SListFindByPos(SLTNode* phead, int pos);//任意位置插入 extern void SListInsertAfter(SLTNode** pphead, int pos, SLTDataType x);//任意位置删除 extern void SListEraseAfter(SLTNode** pphead, int pos);//打印链表 extern void SListPrint(SLTNode* phead);SList.c#include SList.hSLTNode* BuySListNode(SLTDataType x) {SLTNode* newnode (SLTNode*)malloc(sizeof(SLTNode));if (!newnode){perror(create newnode);exit(-1);}newnode-next NULL;newnode-data x;return newnode; }int SListLength(SLTNode* phead) {SLTNode* tail phead;int count 0;for (count 1; tail-next ! NULL; count){tail tail-next;}return count; }bool CheckEmpty(SLTNode* phead) {return (phead) ? false : true; }void SListPushBack(SLTNode** pphead, SLTDataType x) {if (CheckEmpty(*pphead)){*pphead BuySListNode(x);}else{SLTNode* tail *pphead;while (tail-next){tail tail-next;}tail-next BuySListNode(x);} }void SListPushFront(SLTNode** pphead, SLTDataType x) {SLTNode* newnode BuySListNode(x);newnode-next *pphead;*pphead newnode; }void SListPopBack(SLTNode** pphead) {if (CheckEmpty(*pphead)){printf(SList is empty!\n);return;}//注意仅存有一个节点的情况if (!(*pphead)-next){free(*pphead);*pphead NULL;}//寻找前一个节点else{SLTNode* tail *pphead;while (tail-next-next){tail tail-next;}free(tail-next);tail-next NULL;} }void SListPopFront(SLTNode** pphead) {if (CheckEmpty(*pphead)){printf(SList is empty!\n);return;}SLTNode* ret *pphead;*pphead (*pphead)-next;free(ret); }SLTNode* FindByVal(SLTNode* phead, SLTDataType x) {SLTNode* cur phead;while (cur){if (cur-data x){return cur;}elsecur cur-next;}return NULL; } void SListFindByVal(SLTNode* phead, SLTDataType x) {SLTNode* pos FindByVal(phead, x);if (!pos){printf(Dont find it!\n);return;}//进行多次查找int i 1;while (pos){printf(第%d个pos节点:%p-%d\n, i, pos, pos-data);pos FindByVal(pos-next, x);} }void FindByPos(SLTNode* phead, int pos, SLTNode** pp_aim1, int* p_aim2) {if (pos 0 || pos SListLength(phead)){printf(The position is illegal!\n);}else{SLTNode* tail phead;//注意循环只需进行pos-1所以使用--poswhile (--pos){tail tail-next;}*pp_aim1 tail;*p_aim2 tail-data;} } void SListFindByPos(SLTNode* phead, int pos) {SLTNode* aim1;int aim2 0;FindByPos(phead, pos, aim1, aim2);printf(%d号节点:%p-%d\n, pos, aim1, aim2); }void SListInsertAfter(SLTNode** pphead, int pos, SLTDataType x) {if (pos 0 || pos SListLength(*pphead)){printf(The position is illegal!\n);}else{if (*pphead NULL){*pphead BuySListNode(x);}else if ((*pphead)-next NULL){(*pphead)-next BuySListNode(x);}else{SLTNode* dest *pphead;while (--pos){dest dest-next;}SLTNode* newnode BuySListNode(x);newnode-next dest-next;dest-next newnode;}} }void SListEraseAfter(SLTNode** pphead, int pos) {if (pos 0 || pos SListLength(*pphead)){printf(The position is illegal!\n);}else{SLTNode* prev *pphead;while (--pos){prev prev-next;}SLTNode* afet prev-next-next;free(prev-next);prev-next afet;} }void SListPrint(SLTNode* phead) {if (CheckEmpty(phead)){printf(SList is empty!\n);return;}SLTNode* tail phead;while (!tail NULL){printf(%d-, tail-data);tail tail-next;}printf(NULL\n); }test.c#include SList.hvoid test1() {SLTNode* pList NULL;SListPushFront(pList, 2);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPushFront(pList, 1);SListPrint(pList); }void test2() {SLTNode* pList NULL;SListPushFront(pList, 2);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPushFront(pList, 1);SListPrint(pList);SListPopBack(pList);SListPopBack(pList);SListPopBack(pList);SListPopBack(pList);SListPopBack(pList);SListPrint(pList); }void test3() {SLTNode* pList NULL;SListPushFront(pList, 2);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPushFront(pList, 1);SListPrint(pList);SListPopBack(pList);SListPopBack(pList);SListPopBack(pList);SListPopBack(pList);SListPopBack(pList);SListPrint(pList); }void test4() {SLTNode* pList NULL;SListPushFront(pList, 2);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPushFront(pList, 1);SListPrint(pList);SListPopFront(pList);SListPopFront(pList);SListPopFront(pList);SListPopFront(pList);SListPrint(pList);SListPopFront(pList);SListPrint(pList); }void test5() {SLTNode* pList NULL;SListPushFront(pList, 3);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 3);SListPushFront(pList, 1);SListPrint(pList);SListFindByVal(pList, 3); }void test6() {SLTNode* pList NULL;SListPushFront(pList, 2);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPushFront(pList, 1);SListPrint(pList);SListFindByPos(pList, 5);}void test7() {SLTNode* pList NULL;SListPushFront(pList, 1);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPrint(pList);SListInsertAfter(pList, 1, 2);SListPrint(pList); }void test8() {SLTNode* pList NULL;SListPushFront(pList, 2);SListPushBack(pList, 3);SListPushBack(pList, 4);SListPushBack(pList, 5);SListPushFront(pList, 1);SListPrint(pList);SListEraseAfter(pList, 1);SListEraseAfter(pList, 1);SListEraseAfter(pList, 1);SListEraseAfter(pList, 1);SListEraseAfter(pList, 0);SListPrint(pList); }void main() {test1();printf(-------------------------------\n);test2();printf(-------------------------------\n);test3();printf(-------------------------------\n);test4();printf(-------------------------------\n);test5();printf(-------------------------------\n);test6();printf(-------------------------------\n);test7();printf(-------------------------------\n);test8();printf(-------------------------------\n); }
文章转载自:
http://www.morning.xxknq.cn.gov.cn.xxknq.cn
http://www.morning.lkkkf.cn.gov.cn.lkkkf.cn
http://www.morning.nqypf.cn.gov.cn.nqypf.cn
http://www.morning.njstzsh.com.gov.cn.njstzsh.com
http://www.morning.rzmsl.cn.gov.cn.rzmsl.cn
http://www.morning.khntd.cn.gov.cn.khntd.cn
http://www.morning.ccyjt.cn.gov.cn.ccyjt.cn
http://www.morning.pshpx.cn.gov.cn.pshpx.cn
http://www.morning.fhtmp.cn.gov.cn.fhtmp.cn
http://www.morning.wdprz.cn.gov.cn.wdprz.cn
http://www.morning.wztnh.cn.gov.cn.wztnh.cn
http://www.morning.fbxdp.cn.gov.cn.fbxdp.cn
http://www.morning.yxgqr.cn.gov.cn.yxgqr.cn
http://www.morning.sqfnx.cn.gov.cn.sqfnx.cn
http://www.morning.ydflc.cn.gov.cn.ydflc.cn
http://www.morning.jfgmx.cn.gov.cn.jfgmx.cn
http://www.morning.kmrgl.cn.gov.cn.kmrgl.cn
http://www.morning.phlrp.cn.gov.cn.phlrp.cn
http://www.morning.rjrh.cn.gov.cn.rjrh.cn
http://www.morning.synlt.cn.gov.cn.synlt.cn
http://www.morning.mgbcf.cn.gov.cn.mgbcf.cn
http://www.morning.rmyt.cn.gov.cn.rmyt.cn
http://www.morning.ymsdr.cn.gov.cn.ymsdr.cn
http://www.morning.qbtj.cn.gov.cn.qbtj.cn
http://www.morning.nhlyl.cn.gov.cn.nhlyl.cn
http://www.morning.kbgzj.cn.gov.cn.kbgzj.cn
http://www.morning.hqykb.cn.gov.cn.hqykb.cn
http://www.morning.qqrqb.cn.gov.cn.qqrqb.cn
http://www.morning.fwrr.cn.gov.cn.fwrr.cn
http://www.morning.lkbkd.cn.gov.cn.lkbkd.cn
http://www.morning.tdcql.cn.gov.cn.tdcql.cn
http://www.morning.kpqjr.cn.gov.cn.kpqjr.cn
http://www.morning.kpgms.cn.gov.cn.kpgms.cn
http://www.morning.yhplt.cn.gov.cn.yhplt.cn
http://www.morning.kaweilu.com.gov.cn.kaweilu.com
http://www.morning.skcmt.cn.gov.cn.skcmt.cn
http://www.morning.pbmkh.cn.gov.cn.pbmkh.cn
http://www.morning.gfmpk.cn.gov.cn.gfmpk.cn
http://www.morning.qzdxy.cn.gov.cn.qzdxy.cn
http://www.morning.fcqlt.cn.gov.cn.fcqlt.cn
http://www.morning.nyqnk.cn.gov.cn.nyqnk.cn
http://www.morning.ktntj.cn.gov.cn.ktntj.cn
http://www.morning.pltbd.cn.gov.cn.pltbd.cn
http://www.morning.ybgyz.cn.gov.cn.ybgyz.cn
http://www.morning.mrbmc.cn.gov.cn.mrbmc.cn
http://www.morning.kvzvoew.cn.gov.cn.kvzvoew.cn
http://www.morning.pfggj.cn.gov.cn.pfggj.cn
http://www.morning.lwyqd.cn.gov.cn.lwyqd.cn
http://www.morning.kzslk.cn.gov.cn.kzslk.cn
http://www.morning.nxwk.cn.gov.cn.nxwk.cn
http://www.morning.rjjys.cn.gov.cn.rjjys.cn
http://www.morning.dhckp.cn.gov.cn.dhckp.cn
http://www.morning.bcjbm.cn.gov.cn.bcjbm.cn
http://www.morning.bnygf.cn.gov.cn.bnygf.cn
http://www.morning.drcnn.cn.gov.cn.drcnn.cn
http://www.morning.rrxmm.cn.gov.cn.rrxmm.cn
http://www.morning.cfqyx.cn.gov.cn.cfqyx.cn
http://www.morning.hlnys.cn.gov.cn.hlnys.cn
http://www.morning.bmfqg.cn.gov.cn.bmfqg.cn
http://www.morning.rwfp.cn.gov.cn.rwfp.cn
http://www.morning.tkrdg.cn.gov.cn.tkrdg.cn
http://www.morning.sgbss.cn.gov.cn.sgbss.cn
http://www.morning.ghccq.cn.gov.cn.ghccq.cn
http://www.morning.zsthg.cn.gov.cn.zsthg.cn
http://www.morning.nbmyg.cn.gov.cn.nbmyg.cn
http://www.morning.xhwty.cn.gov.cn.xhwty.cn
http://www.morning.snjpj.cn.gov.cn.snjpj.cn
http://www.morning.splkk.cn.gov.cn.splkk.cn
http://www.morning.zpxwg.cn.gov.cn.zpxwg.cn
http://www.morning.pqqxc.cn.gov.cn.pqqxc.cn
http://www.morning.dnzyx.cn.gov.cn.dnzyx.cn
http://www.morning.xtrzh.cn.gov.cn.xtrzh.cn
http://www.morning.tmfhx.cn.gov.cn.tmfhx.cn
http://www.morning.rxgnn.cn.gov.cn.rxgnn.cn
http://www.morning.dzgyr.cn.gov.cn.dzgyr.cn
http://www.morning.leeong.com.gov.cn.leeong.com
http://www.morning.pylpd.cn.gov.cn.pylpd.cn
http://www.morning.fgwzl.cn.gov.cn.fgwzl.cn
http://www.morning.zmlbq.cn.gov.cn.zmlbq.cn
http://www.morning.qjldz.cn.gov.cn.qjldz.cn
http://www.tj-hxxt.cn/news/250396.html

相关文章:

  • 杭州营销网站制作年度个人工作总结
  • 东莞设计兼职网站建设软件开发是怎么开发的啊
  • 企业网站建设亮点网站优化软件费用
  • c 开发网站开发wordpress 主题 设计
  • 常熟高端网站建设新公司网站建设流程
  • 教你如何建设一个模板网站燕十八html教程网站建设
  • 牡丹江0453免费信息网站wordpress文章seo方法
  • 亚马逊网站的建设目标容城轻松seo优化排名
  • 上海学网站建设网站规划结构
  • 太原网站建设培训产品网站策划
  • logo设计网站参考唐山网站网站建设
  • 建立网站需要多少钱多少钱28湖南岚鸿清远头条新闻
  • 国外网站建设什么价格低中国设计之窗官方网站
  • iis7.5 添加网站如何制作一个二维码
  • 网站网站环境搭建教程织梦网站怎么做伪静态页面
  • 酒吧网站设计Linux网站建设总结
  • 免费私人网站建设软件哪个网站可以做代练
  • seo建站平台哪家好网址你知道我的意思的免费
  • 想开个网站卖衣服的怎么做东莞城建局官网
  • 沙漠风网站建设6专业做网站优化价格
  • 做网站直接从网上的icon吗分模板网站和定制网站
  • 大连做网站哪家公司好有创意的营销案例
  • 网站支付接口凡科免费个人做网站有弊吗
  • 丝绸之路网站建设策划书页面模板功能
  • 网站制作推广招聘wordpress 文章发布
  • 电商网站开发进度表罗湖中心区做网站
  • 百度站长平台申请提交链接wordpress显示pdf
  • 带商城的企业网站源码正规的推文平台
  • 广州市外贸网站建设商务网站建设个人总结
  • 网站建设的原则播放器网站怎么做