数据结构-c
彼岸BA
这个作者很懒,什么都没留下…
展开
-
SCAU-8642-数据结构-快速排序
#include <iostream>#include <stdio.h>using namespace std;int n;void travel(int a[]) { for (int i = 0; i < n; i++) { cout << a[i] << " "; } cout << endl;}int partition(int a[],int low,int high) { //pivot是一个 a[.原创 2022-05-23 17:28:07 · 214 阅读 · 0 评论 -
SCAU-8621-数据结构-二分查找
#include"malloc.h" /* malloc()等 */#include"stdio.h"#include"stdlib.h"typedef int ElemType;typedef struct /*静态查找表的顺序存储结构 */{ ElemType *elem; /* 数据元素存储空间基址,建表时按实际长度分配,0号单元留空 */ int length; /* 表长度 */}SSTable;SSTable ST;void Creat_Seq(SSTable &.原创 2022-05-14 22:04:55 · 250 阅读 · 0 评论 -
SCAU-8610-数据结构-顺序查找
#include"malloc.h" /* malloc()等 */#include"stdio.h"#include"stdlib.h"typedef int ElemType;typedef struct /*静态查找表的顺序存储结构 */{ ElemType *elem; /* 数据元素存储空间基址,建表时按实际长度分配,0号单元留空 */ int length; /* 表长度 */}SSTable;void Creat_Seq(SSTable &ST,int n){.原创 2022-05-14 22:01:42 · 158 阅读 · 0 评论 -
火车进站 OJ考试
#include<malloc.h> #include<stdio.h> #define OK 1#define ERROR 0#define STACK_INIT_SIZE 100 // 存储空间初始分配量#define STACKINCREMENT 10 // 存储空间分配增量typedef int SElemType; // 定义栈元素类型typedef int Status; // Status是函数的类型,其值是函数结果状态代码,如OK等struct .原创 2022-04-30 10:19:36 · 141 阅读 · 0 评论 -
SCAU-18924-数据结构-二叉树的宽度
#include "stdio.h"#include "stdlib.h"#include<iostream>#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASLBLE -1#define OVERFLOW -2#define MAXSTRLEN 255 //用户可在255以内定义最大串长typedef unsigned char SString[MAXSTRLEN +.原创 2022-04-23 22:48:07 · 1832 阅读 · 0 评论 -
SCAU-187220-数据结构-稀疏矩阵的运算 (选做)
#include "stdio.h"#include "stdlib.h"#include<iostream>#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASLBLE -1#define OVERFLOW -2#define MAXSTRLEN 255 //用户可在255以内定义最大串长typedef unsigned char SString[MAXSTRLEN +.原创 2022-04-23 11:55:41 · 1437 阅读 · 0 评论 -
SCAU-8592-数据结构- KMP算法
#include "stdio.h"#include "stdlib.h"#include<iostream>#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASLBLE -1#define OVERFLOW -2#define MAXSTRLEN 255 //用户可在255以内定义最大串长typedef unsigned char SString[MAXSTRLEN +.原创 2022-04-23 10:09:30 · 205 阅读 · 0 评论 -
SCAU-18973-数据结构-阿克曼(Ackmann)函数
#include<malloc.h>#include<stdio.h>#include<stdlib.h>int akm(int m,int n) { if (m == 0) { return n+1; } else if (m > 0 && n == 0) { akm(m - 1, 1); } else if (m>0&&n>0) { akm(m - 1, akm(m, n - 1));.原创 2022-04-16 23:33:56 · 1033 阅读 · 0 评论 -
SCAUOJ数据结构实验 8590 队列的应用——银行客户平均等待时间
#include<malloc.h>#include<stdio.h>#include<stdlib.h>#define OK 1#define ERROR 0typedef int Status; // Status是函数的类型,其值是函数结果状态代码,如OK等typedef int QElemType;#define MAXQSIZE 100 // 最大队列长度(对于循环队列,最大队列长度要减1)typedef struct{ QElemTyp.原创 2022-04-16 21:57:35 · 472 阅读 · 0 评论 -
SCAU-18938-数据结构-汉诺塔问题
//汉诺塔问题,打印的是整个的移动过程#include <stdio.h>void hanoi(int n, char A, char B, char C)//n个圈圈在柱子A上,借助柱子B,移动到柱子C上{ if (n == 1)//如果A柱子上只有一个圈圈,直接移动到B上 printf("%c->%d->%c\n", A,n, B); else { hanoi(n - 1, A, C, B);//将A柱子上的n-1个圈圈,借助柱子B,移动到柱子C上...原创 2022-04-15 15:42:00 · 1118 阅读 · 0 评论 -
SCAU-数据结构-行编辑程序
typedef char SElemType;#include"malloc.h" #include"stdio.h"#include"math.h"#include"stdlib.h" // exit()#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0typedef int Status; // Status是函数的类型,其值是函数结果状态代码,如OK等#define STACK_INIT_SIZE 10 // 存储空间.原创 2022-04-01 00:25:39 · 228 阅读 · 0 评论