acm(链表)
题目
不会编程怎么行
fighting
展开
-
B - 数据结构实验之链表二:逆序建立链表(头插法)
#include<bits/stdc++.h>using namespace std;struct node{ int data; node *next;};int main(){ struct node*head; head=new node(); head->next=NULL; node *p, *q; ...原创 2020-03-12 20:06:02 · 188 阅读 · 0 评论 -
A - 数据结构实验之链表一:顺序建立链表(尾插法)
#include<bits/stdc++.h>using namespace std;struct node{ int data; node *next;};int main(){ struct node*head; head=new node(); head->next=NULL; node *p, *q; ...原创 2020-03-12 20:07:10 · 215 阅读 · 0 评论 -
C - 师--链表的结点插入
#include<bits/stdc++.h>using namespace std;struct node{ int data; node *next;};void _insert(struct node *head,int m,int x){ struct node *p=head; int _count=-1; while(_...原创 2020-03-12 20:08:39 · 214 阅读 · 0 评论 -
D - 数据结构实验之链表七:单链表中重复元素的删除
#include<bits/stdc++.h>using namespace std;struct node{ int data; node *next;};int main(){ node *head; head = new node(); head->next = NULL; int n; cin>&...原创 2020-03-12 20:09:43 · 112 阅读 · 0 评论 -
E - 数据结构实验之链表三:链表的逆置
#include<bits/stdc++.h>using namespace std;struct node{ int data; node *next;};int main(){ struct node*head; head=new node(); head->next=NULL; node *p, *q; ...原创 2020-03-12 20:11:44 · 103 阅读 · 0 评论 -
F - 数据结构实验之链表四:有序链表的归并
#include<bits/stdc++.h>using namespace std;struct node{ int data; node *next;};int main(){ node *head1,*head2; head1=new node(); head2=new node(); head1->next=N...原创 2020-03-12 20:12:33 · 217 阅读 · 0 评论 -
G - 数据结构实验之链表五:单链表的拆分
#include <iostream>using namespace std;struct node{ int data; node *next;};int main(){ node *head; head = new node(); head->next = NULL; int n; cin>>...原创 2020-03-12 20:13:17 · 108 阅读 · 0 评论