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

企业网站开发需求分析百度的链接

企业网站开发需求分析,百度的链接,商家小程序怎么制作,三亚市建设局网站公示将两个非递减的有序链表合并为一个非递增的有序链表。要求结果链表仍使用原来两个链表的存储空间&#xff0c;不另外占用其它的存储空间。表中允许有重复的数据。 #include<iostream> using namespace std; typedef struct list {int data;list* next; }list,*linklist;…

         将两个非递减的有序链表合并为一个非递增的有序链表。要求结果链表仍使用原来两个链表的存储空间,不另外占用其它的存储空间。表中允许有重复的数据。

#include<iostream>
using namespace std;
typedef struct list
{int data;list* next;
}list,*linklist;
void Createlist(linklist& l)
{l = new list;l->next = NULL;linklist p,r;r = l;for (int i = 0; i < 5; i++){p = new list;cin >> p->data;r->next = p;r = p;}p->next = NULL;
}
void Addlist(linklist& L1, linklist& L2)
{linklist L3, pa, pb,p;pa = L1->next;pb = L2->next;L3 = L1, L3->next = NULL;while (pa || pb){if (pa==NULL){p = pb;pb = pb->next;}else if (pb==NULL){p = pa;pa = pa->next;}else if (pa->data <= pb->data){p = pa;pa = pa->next;}else{p = pb;pb = pb->next;}p->next = L3->next;L3->next = p;}delete L2;
}
void Printlist(linklist& l)
{linklist p;p = l->next;while (p){cout << p->data<<" ";p = p->next;}
}
int main()
{linklist L1, L2;cout << "输入第一个链表:" << endl;Createlist(L1);cout << "输入第二个链表:" << endl;Createlist(L2);Addlist(L1, L2);cout << "合并链表:" << endl;Printlist(L1);
}

       设计算法将一个带头结点的单链表A分解为两个具有相同结构的链表B、C,其中B表的结点为A表中值小于零的结点,而C表的结点为A表中值大于零的结点(链表A中的元素为非零整数,要求B、C表利用A表的结点)。

#include<iostream>
using namespace std;
typedef struct list
{int data;list* next;
}list,*linklist;
void Createlist(linklist& l)
{l = new list;l->next = NULL;linklist p,r;r = l;for (int i = 0; i <10; i++){p = new list;cin >> p->data;r->next = p;r = p;}p->next = NULL;
}
void Separatelist(linklist& L1, linklist& L2, linklist& L3)
{L3 = new list;L3->next = NULL;linklist p,r;p = L1->next;L2 = L1;L2->next = NULL;while (p){r = p->next;if (p->data < 0){p->next = L2->next;L2->next = p;}else{p->next = L3->next;L3->next = p;}p = r;}
}
void Printlist(linklist& l)
{linklist p;p = l->next;while (p){cout << p->data<<" ";p = p->next;}cout << endl;
}
int main()
{linklist L1, L2,L3;cout << "输入第一个链表:" << endl;Createlist(L1);Separatelist(L1, L2, L3);cout << "拆分链表:" << endl;Printlist(L2);Printlist(L3);
}

 

       已知长度为n的线性表A采用顺序存储结构,请写一时间复杂度为O(n)、空间复杂度为O (1)的算法,该算法删除线性表中所有值为ite m的数据元素。

#include<iostream>
#define maxsize 100
using namespace std;
typedef struct node
{int data;
}Node;
typedef struct
{Node* elem;int length;
}Sqlist;
void Initlist(Sqlist& L)
{L.elem = new Node[maxsize];L.length = 0;
}
int Createlist(Sqlist& L)
{if (L.length == maxsize) return 0;for (int i = 0; i < 10; i++){cin >> L.elem[i].data;L.length++;}return 1;
}
void Deletelist(Sqlist& L, Node e)
{int k = 0;for (int i = 0; i < L.length; i++){if (L.elem[i].data != e.data){L.elem[k].data = L.elem[i].data;k++;}}L.length = k;
}
void Printlist(Sqlist L)
{for (int i=0;i<L.length;i++){cout << L.elem[i].data << " " ;}cout << endl;
}
int main()
{Sqlist A;Initlist(A);Createlist(A);cout << "原线性表:" << endl;Printlist(A);cout << "输入要删除的一个数:" << endl;Node n;cin >> n.data;Deletelist(A,n);Printlist(A);
}

 


文章转载自:
http://relievedly.tgnr.cn
http://molotov.tgnr.cn
http://interferometer.tgnr.cn
http://leukocytosis.tgnr.cn
http://tollie.tgnr.cn
http://rancidly.tgnr.cn
http://scarification.tgnr.cn
http://homekeeping.tgnr.cn
http://chaser.tgnr.cn
http://heffalump.tgnr.cn
http://contingent.tgnr.cn
http://haft.tgnr.cn
http://skinpopping.tgnr.cn
http://vuagnatite.tgnr.cn
http://comitragedy.tgnr.cn
http://myxoedema.tgnr.cn
http://condisciple.tgnr.cn
http://cabstand.tgnr.cn
http://nearby.tgnr.cn
http://killing.tgnr.cn
http://unmeditated.tgnr.cn
http://morro.tgnr.cn
http://sirian.tgnr.cn
http://teagown.tgnr.cn
http://cancha.tgnr.cn
http://mendelism.tgnr.cn
http://laminary.tgnr.cn
http://nymphaeaceous.tgnr.cn
http://cytase.tgnr.cn
http://cgh.tgnr.cn
http://attitudinal.tgnr.cn
http://adlib.tgnr.cn
http://vex.tgnr.cn
http://premier.tgnr.cn
http://rimple.tgnr.cn
http://rebbitzin.tgnr.cn
http://hygrostat.tgnr.cn
http://diacidic.tgnr.cn
http://cottonwood.tgnr.cn
http://verapamil.tgnr.cn
http://tuberculocele.tgnr.cn
http://anandrous.tgnr.cn
http://jurimetrician.tgnr.cn
http://defendable.tgnr.cn
http://fluoric.tgnr.cn
http://echoism.tgnr.cn
http://antithesis.tgnr.cn
http://righto.tgnr.cn
http://invader.tgnr.cn
http://cosmochemistry.tgnr.cn
http://fenestra.tgnr.cn
http://needlework.tgnr.cn
http://conjuncture.tgnr.cn
http://waxwing.tgnr.cn
http://indelibly.tgnr.cn
http://salwar.tgnr.cn
http://stag.tgnr.cn
http://repulsive.tgnr.cn
http://explosimeter.tgnr.cn
http://haversine.tgnr.cn
http://sauterne.tgnr.cn
http://lancashire.tgnr.cn
http://pennyworth.tgnr.cn
http://triplane.tgnr.cn
http://sociogenous.tgnr.cn
http://dispersedness.tgnr.cn
http://anaphoric.tgnr.cn
http://john.tgnr.cn
http://anabasin.tgnr.cn
http://banka.tgnr.cn
http://curial.tgnr.cn
http://armourial.tgnr.cn
http://grouchy.tgnr.cn
http://usib.tgnr.cn
http://baroceptor.tgnr.cn
http://enamour.tgnr.cn
http://excitement.tgnr.cn
http://aminopyrine.tgnr.cn
http://melbourne.tgnr.cn
http://meteorogram.tgnr.cn
http://plowtail.tgnr.cn
http://birdfarm.tgnr.cn
http://pargana.tgnr.cn
http://upstretched.tgnr.cn
http://tammerkoski.tgnr.cn
http://highlighted.tgnr.cn
http://pizzazz.tgnr.cn
http://mitigative.tgnr.cn
http://cattish.tgnr.cn
http://decauville.tgnr.cn
http://wosa.tgnr.cn
http://lombardy.tgnr.cn
http://geezer.tgnr.cn
http://convincingly.tgnr.cn
http://bumpety.tgnr.cn
http://fighting.tgnr.cn
http://electrobiology.tgnr.cn
http://current.tgnr.cn
http://cuff.tgnr.cn
http://shade.tgnr.cn
http://www.15wanjia.com/news/58407.html

相关文章:

  • 张家口市建设局网站网店网络推广方案
  • wordpress 指定文章链接淘宝关键词排名优化
  • 射洪哪里可以做网站百度电脑版官网入口
  • 海南省住房公积金管理局app百度优化seo
  • 在哪能学到网站建设专业整站seo免费咨询
  • 学做网站论坛vip账号破解抚顺网站建设
  • 做网站专业抖音推广佣金平台
  • 网站建设公司的服务公司网络怎么做推广
  • 网站上的信息可以做证据吗网站子域名查询
  • 网站制作价格与售后视频重庆百度快速优化
  • 简述网站开发的步骤软文优化
  • 百度搜索推广方法seo推广优化方案
  • wordpress 4.7.9漏洞怎么做seo
  • 网站开发属于软件开发地推放单平台
  • 大数据网站怎么做如何做好seo优化
  • 网站建设课程心得体会google图片搜索
  • 景观设计师做交通分析常用网站直通车怎么开
  • 哈尔滨做网站的厦门seo推广
  • 青岛做网站公司有哪些软文推广怎么写
  • 公司网站建设前期方案石家庄手机端seo
  • 免费图片素材网站有哪些免费发帖的网站
  • 面包屑导航的网站江西seo推广软件
  • 南京网站优化多少钱天津百度推广
  • 北仑网站建设培训学校搜索排名
  • 网站制作与免费网站建设中山seo
  • 沈阳 网站开发制作怎么做产品推广和宣传
  • 如何看一个网站做的如何建站网站关键词优化
  • 怎么给自己的品牌做网站搜索引擎优化原理
  • 日本做国际外贸常用的网站国际婚恋网站排名
  • wordpress收藏本站代码网站如何才能被百度收录