首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
ZeroQi_404
2026年3月11日 23:03
单链表 题解:
P1015
回复 0
|
赞 2
|
浏览 90
#include <iostream> #include <list> using namespace std; int main(){ list<int> L; for(int i = 0; i < 5; i++){ int x; cin >> x; L.push_back(x); } L.sort(); list<int>::iterator it; for(it = L....
AORIE
2026年3月11日 10:15
单链表 题解:
P1015
回复 0
|
赞 3
|
浏览 109
发个C版本的,要改造一下结构体 重命名才能使用Node,没招 #include <stdio.h> #include <stdlib.h> typedef struct Node { int Element; // 节点中的元素为整数类型 struct Node * Next; // 指向下一个节点 }Node; void mp(int a[],int lenth){ ...
5653565
2026年3月9日 22:34
单链表 题解:
P1015
回复 0
|
赞 6
|
浏览 107
鄙人愚钝,只会链表冒泡,每趟至少一个元素排到最终位置,来5趟就行 #include <bits/stdc++.h> using namespace std; struct Node { int element; // 节点中的元素为整数类型 struct Node * next; // 指向下一个节点 }; int main() { Node *head=new Node(); head->next=NULL; Node *p=head; int n; for(int i=0;i<...
New_chapter
2026年2月28日 16:14
单链表 题解:包直观
P1015
回复 0
|
赞 18
|
浏览 349
#include<iostream> using namespace std; struct Node{ int Element; struct Node*Next; }; int main(){ Node*head=new Node(); head->Next=NULL; for(int i=0;i<5;i++) { int num; cin >> num; Node *p = h...
bro
2026年2月24日 19:47
单链表 题解:
P1015
回复 0
|
赞 8
|
浏览 162
#include <bits/stdc++.h> using namespace std; struct Node{ int Element; struct Node *next; }; int main(){ int arr[7] = {0}; cin >> arr[0] >> arr[1] >> arr[2] >> arr[3] >> arr[4]; &nbs...
xsw
2026年2月2日 09:51
单链表 题解:
P1015
回复 0
|
赞 16
|
浏览 302
#include<iostream> using namespace std; struct Node { int val; struct Node *next; Node(int x): val(x), next(NULL) { } }; int main() { Node *node = new Node(-1); Node *head = node; head->next = NULL; for (int i = 0; i < 5; i ++ ) { int x; cin >>...
mlx
2026年1月25日 20:58
单链表 题解:
P1015
回复 0
|
赞 13
|
浏览 246
#include<iostream> #include<algorithm> #include<vector> using namespace std; vector<int> a; struct Node{ int x; struct Node *next; }; Node *l; int main() { l=new Node; l->next=nullptr; for(int i=0;i<5;i++) { int t; cin>>t; ...
曾不会
2026年1月24日 16:25
单链表 题解:
P1015
回复 0
|
赞 2
|
浏览 228
//用冒泡 #include<stdio.h> int main() { int a[5]; for(int i=0;i<5;i++) { scanf("%d",&a[i]); } for(int i=0;i<5;i++) &nb...
leo110
2025年5月3日 17:49
单链表 题解:只为锻炼手搓单链表和相关功能
P1015
回复 0
|
赞 17
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; struct Node{ int Element; struct Node *Next; }; Node *create(vector<int> num){ Node *head=nullptr,*q=nullptr;//声明同时赋值,防止出现野指针 for(int i=0;i<5;i++){//...
Xsw777
2025年3月3日 10:21
单链表 题解:用单链表的冒泡排序 C语言
P1015
回复 0
|
赞 37
|
浏览 1.8k
#include <stdio.h> #include <stdlib.h> typedef struct Node{ int data; struct Node* next; }LNode,*LinkList; //排序 void BubbleSort(LinkList L){ LNode*pre,*p,*a; a = (LNode*)malloc(sizeof(LNode)); &nbs...
1
2
3
...
5
题目
单链表
题解数量
47
发布题解
在线答疑
热门题解
1
单链表 题解:用单链表的冒泡排序 C语言
2
单链表 题解:
3
单链表 题解:包直观
4
单链表 题解:只为锻炼手搓单链表和相关功能
5
单链表 题解:不会真以为我会用链表吧孩子
6
单链表 题解:顺便回忆一下头插法
7
单链表 题解:
8
(单链表的创建和排序)练习是学知识的,钻空子没有意义
9
单链表 题解:
10
单链表 题解: