- 博客(6)
- 收藏
- 关注
转载 二叉树的几个基本算法
#include "stdio.h" #include "malloc.h" #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 #define MAX_SIZE 100 typedef int Status; typedef char E...
2019-04-03 23:45:10 558
转载 渣牛(AWA)POJ-3278
广度优先搜索 使用队列,可以想象成一棵树, 若在任一子结点找到答案,所在深度都是一样的,也就是步数相同 搜寻的方法也理所当然是先左右,再上下,所以使用队列 (标记曾经走的点) #include<malloc.h> #include<stdio.h> #include<stdlib.h> #include <string.h> #define OK 1...
2019-04-01 23:50:08 172
原创 分数拆分
#include <iostream> #include<algorithm> #include <stdio.h> #include <string.h> #include <vector> using namespace std; /** 分数拆分 **/ int main() { int k; scanf("%d...
2019-03-21 21:17:18 107
原创 除法(非常非常非常简单的暴搜TAT)
输入整数n,按从小到大的顺序输出所有形如abdce/fghij = n的表达式 其中aj恰好是09的一个 排列(可以有前导0) 石路: 暴搜也别太暴力,可以大概想想边界什么的,可以略微优化一下,或者。。。。 反正认真分析一下可能有惊喜! #include <iostream> #include<algorithm> #include <stdio.h> #inc...
2019-03-20 23:57:55 289
原创 行编辑程序(栈实现)
#include<malloc.h> #include<stdio.h> #include<stdlib.h> #include<math.h> #define OK 1 #define ERROR 0 #define STACK_INIT_SIZE 100 #define STACKINCREMENT 10 typedef char SElemT...
2019-03-19 19:02:26 1445
转载 归并排序
时间复杂度:T(n) = O(n㏒n),空间复杂度:S(n) = O(n) 就是将一个大的数组一直二等分,分分分分分.。。。。。 分到只有一个元素的时候,再和上次分离的小伙伴合并在一起, 并且排好序 #include <stdio.h> #define MAXSIZE 105 int T[MAXSIZE]; //辅助空间 void merge_sort...
2019-03-19 12:55:09 85
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人