摘要: #include <iostream> //考研初始只需要完成setPartition即可 int setPartition(int a[],int n) { int pivotkey,low=0,low0 = 0,high=n-1,high0=n-1,flag=1,k=n/2,i; int s1= 阅读全文
posted @ 2023-04-14 17:48 ha_1007 阅读(27) 评论(0) 推荐(0)
摘要: Description 读取10个整型数据12 63 58 95 41 35 65 0 38 44,然后通过归并排序,对该组数据进行排序,输出有序结果,每个数的输出占3个空格 Input 12 63 58 95 41 35 65 0 38 44 Output 0 12 35 38 41 44 58 阅读全文
posted @ 2023-04-14 16:02 ha_1007 阅读(28) 评论(0) 推荐(0)
摘要: 读取10个整型数据12 63 58 95 41 35 65 0 38 44,然后通过选择排序,堆排序,分别对该组数据进行排序,输出2次有序结果,每个数的输出占3个空格 #include <stdio.h> #include <stdlib.h> #include <time.h> #include 阅读全文
posted @ 2023-04-14 15:55 ha_1007 阅读(25) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #define N 7 typedef int ElemType; void Merge(ElemType A[],int low,int mid,int high) { static ElemType B[N]; //加 阅读全文
posted @ 2023-04-14 14:51 ha_1007 阅读(37) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string> typedef int ElemType; typedef struct { ElemType *elem; //存储元素的起始地址 int Tabl 阅读全文
posted @ 2023-04-14 11:22 ha_1007 阅读(26) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string> typedef int ElemType; typedef struct { ElemType *elem; //存储元素的起始地址 int Tabl 阅读全文
posted @ 2023-04-13 22:09 ha_1007 阅读(36) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string> typedef int ElemType; typedef struct { ElemType *elem; //存储元素的起始地址 int Tabl 阅读全文
posted @ 2023-04-13 17:51 ha_1007 阅读(25) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string> typedef int ElemType; typedef struct { ElemType *elem; //存储元素的起始地址 int Tabl 阅读全文
posted @ 2023-04-13 17:29 ha_1007 阅读(26) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string> typedef int ElemType; typedef struct { ElemType *elem; //存储元素的起始地址 int Tabl 阅读全文
posted @ 2023-04-13 16:23 ha_1007 阅读(23) 评论(0) 推荐(0)
摘要: Description 读取10个元素 87 7 60 80 59 34 86 99 21 3,然后建立二叉查找树,中序遍历输出3 7 21 34 59 60 80 86 87 99,针对有序后的元素,存入一个长度为10的数组中,通过折半查找找到21的下标(下标为2),然后输出2 Input 标准输 阅读全文
posted @ 2023-04-13 15:15 ha_1007 阅读(29) 评论(0) 推荐(0)