09 2021 档案

摘要:#include<stdio.h> #include<stdlib.h> typedef struct Node { int data; struct Node* next; }Node,*List; void Print(List L) { Node* node; node = L->next; 阅读全文
posted @ 2021-09-30 14:15 磐正 阅读(22) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<stdlib.h> typedef struct Node { char data; struct Node* next; }Node, *List; //分成三段创建链表 Node* CreateList(List L, int length) 阅读全文
posted @ 2021-09-29 13:46 磐正 阅读(27) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<stdlib.h> typedef struct Node { int data; struct Node* next; }Node,*List; void ReverseList(List L) { Node* node1; Node* nod 阅读全文
posted @ 2021-09-28 22:29 磐正 阅读(140) 评论(1) 推荐(0)
摘要:1.暴力解法 #include<stdio.h> #include<stdlib.h> void Reverse_p(int arr[], int p, int length) { int index=0; int* A=(int*)malloc(sizeof(int)*length); for(i 阅读全文
posted @ 2021-09-28 18:35 磐正 阅读(33) 评论(0) 推荐(0)
摘要:1.暴力解法,不推荐使用 #include<stdio.h> void Swap(int& a, int& b) { int temp; temp=a; a=b; b=temp; } void BubbleSort(int arr[], int length) { int temp; for(int 阅读全文
posted @ 2021-09-27 23:33 磐正 阅读(53) 评论(4) 推荐(0)
摘要:#include<stdio.h> #include<stdlib.h> typedef struct Node { int data; struct Node* next; }Node,*List; void CreateList(List L, int k) { Node* node; Node 阅读全文
posted @ 2021-09-24 22:59 磐正 阅读(71) 评论(0) 推荐(0)
摘要:#include<stdlib.h> #include<stdio.h> //定义结构体 typedef struct Node { int data; struct Node* link; }Node,*List; //创建链表函数 void CreateList(List L, int k) { 阅读全文
posted @ 2021-09-24 00:07 磐正 阅读(21) 评论(1) 推荐(0)
摘要:#include<stdlib.h> #include<stdio.h> //定义结构体 typedef struct Node { int data; struct Node* link; }Node,*List; //创建链表函数 void CreateList(List L, int k) { 阅读全文
posted @ 2021-09-23 22:58 磐正 阅读(69) 评论(0) 推荐(0)
摘要:#include<stdio.h> void MergeSort(int* pa,int* pb) { int arr[12]; int a,b,i; a=b=0; for(i=0;i<12&&a<6&&b<6;i++) { if(*(pa+a)<=*(pb+b)) { arr[i]=*(pa+a) 阅读全文
posted @ 2021-09-23 21:39 磐正 阅读(15) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<stdlib.h> typedef struct Node { int data; struct Node* next; }Node, *List; //遍历链表函数 void outputValue(List L) { Node* node=L 阅读全文
posted @ 2021-09-23 00:01 磐正 阅读(18) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<stdlib.h> typedef struct Node{ int data; struct Node* next; }Node; void changeValue(Node& node)//引用 { node.data++; } void p 阅读全文
posted @ 2021-09-22 10:37 磐正 阅读(111) 评论(1) 推荐(0)
摘要:Position BinarySearch(List L, ElementType X){ Position Left,Right,Mid; Left=1; Right=L->Last; while(Left<=Right){ Mid=(Left+Right)/2; if(X==L->Data[Mi 阅读全文
posted @ 2021-09-22 09:50 磐正 阅读(52) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-09-04 17:55 磐正 阅读(71) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<iostream> using namespace std; int main(int argc, char* argv[]) { int i; for (i = 0; i < argc; i++) cout << argv[i] << endl 阅读全文
posted @ 2021-09-01 17:14 磐正 阅读(53) 评论(5) 推荐(0)