
关于链表
相似的人适合打闹
这个作者很懒,什么都没留下…
展开
-
求三链表公共元素
求链表 A B C 共有元素本题要求找到公有元素后将三个链表中所有非公有元素都删除#include<bits/stdc++.h>using namespace std;struct LNode{ int data; struct LNode *next;};void creathead(LNode *&L,int a[],int n)///尾插...原创 2020-02-24 14:15:03 · 311 阅读 · 1 评论 -
求链表集合操作
求A 并(B交C)#include<bits/stdc++.h>using namespace std;struct LNode{ int data; struct LNode *next;};void creathead(LNode *&L,int a[],int n)///尾插{ LNode *r,*s; L=(LNode*)...原创 2020-02-24 14:13:25 · 208 阅读 · 0 评论 -
删除链表中重复元素的两种操作
删除链表中重复元素的两种操作#include<bits/stdc++.h>using namespace std;struct LNode{ int data; struct LNode *next;};void create(LNode *&L,int a[],int n)///尾插法建表{ LNode *r,*s; L=(LN...原创 2020-02-24 14:11:48 · 389 阅读 · 0 评论 -
链表最值处理操作
链表中最小值移到表头#include<bits/stdc++.h>using namespace std;struct LNode{ int data; LNode *next;};void creathead(LNode *&L,int a[],int n)///尾插法{ LNode *r,*s; L=(LNode*)mallo...原创 2020-02-24 14:08:59 · 202 阅读 · 0 评论 -
链表插入排序
单链表插入排序#include<bits/stdc++.h>using namespace std;struct LNode{ int data; LNode *next;};void creathead(LNode *&L,int a[],int n)///尾插法{ LNode *r,*s; L=(LNode*)malloc(s...原创 2020-02-24 14:08:11 · 124 阅读 · 0 评论 -
链表逆置合集
链表逆置#include<bits/stdc++.h>using namespace std;struct LNode{ int data; LNode *next;};void creathead(LNode *&L,int a[],int n)///尾插法{ LNode *r,*s; L=(LNode*)malloc(size...原创 2020-02-24 14:03:54 · 209 阅读 · 0 评论 -
7-51 两个有序链表序列的合并 (20 分)
已知两个非降序链表序列S1与S2,设计函数构造出S1与S2合并后的新的非降序链表S3。输入格式:输入分两行,分别在每行给出由若干个正整数构成的非降序序列,用−1表示序列的结尾(−1不属于这个序列)。数字用空格间隔。输出格式:在一行中输出合并后新的非降序链表,数字间用空格分开,结尾不能有多余空格;若新链表为空,输出NULL。输入样例:1 3 5 -12 4 6 8 10 ...原创 2019-11-23 17:48:08 · 558 阅读 · 0 评论