- 博客(12)
- 收藏
- 关注
原创 java动态代理
java动态代理标题 代理介绍 标题 代理介绍 每一个业务都分为业务准备工作、业务核心工作、业务收尾工作这三个阶段,如果我们只想做的是业务的核心工作,那么我们就可以委托一个代理者来帮我们做剩下的其它工作,这种工作做方式称为代理模式。例如 当我们想买一部车,但又不想亲自去寻找商店,选品牌,讲价等等工作,此时就可以委托一个人替我们去办这些事,等他都弄好了到付钱的时候我们直接付钱就ok。 直接上代码 /...
2019-09-24 20:44:43
136
原创 整数因子分解问题
#include <bits/stdc++.h> using namespace std; int a[200000],dp[200000];//dp: 第i个约数能够再进行分解的式子个数 int f(int n){ int i,j, k = 0; for(i = 2; i<=sqrt(n); i++)//计算出n的所有约数并存放在数组a中 { if(n%i==0){ a[k++...
2019-03-12 20:51:24
965
原创 以结构体内的数据为依据对结构体数组排序
#include <bits/stdc++.h> using namespace std; struct node { char name[10]; }N[10]; int cmp(const void *a, const void *b) { node *c = (node *)a;//将为止类型a强行转化为结构体类型 node *d = (node *)b;...
2018-09-10 19:52:50
2181
原创 单源最短路径
#include <bits/stdc++.h> using namespace std; #define inf 999999999 int a[102][102], vis[102], b[102]; void dis(int k,int n) { int i,t; int m = n-1; while(m--) { int Min ...
2018-09-09 13:44:01
749
原创 多源最短路径
#include <bits/stdc++.h> using namespace std; #define inf 999999999 int a[102][102]; int main() { int n, m, x,y,z,i,j; while(~scanf("%d%d",&n,&m)) { for(i = 1; i<=...
2018-09-09 11:19:14
746
原创 数据结构实验之图论九:最小生成树
#include <bits/stdc++.h> using namespace std; #define cf 999999999 int a[102][102], visit[102], b[102]; void Prim(int n) { int i; int sum = 0; int m = n-1;//n个节点的图只需要寻找n-1条边; vis...
2018-09-09 09:55:46
593
原创 图的遍历之DFS,BFS
#include <bits/stdc++.h> using namespace std; int a[105][105], t = 0, b[105], c[105]; void DFS(int k, int n) { int i; c[t++] = k; b[k] = 1; for(i = 0; i<n; i++) { ...
2018-09-08 22:04:04
141
原创 平衡二叉树
平衡二叉树的建立是基于二叉排序树的 #include <bits/stdc++.h> using namespace std; struct Tree { int date; Tree *left;//左子树 Tree *right;//右子树 }; int Hight(Tree *T)//求数的深度 { int LH, RH, H; if(...
2018-09-03 23:35:00
134
原创 排序二叉树之中序输出,深度输出
#include &lt;bits/stdc++.h&gt; #include&lt;string.h&gt; using namespace std; struct tree { int date; tree *left;//左子树 tree *reght;//右子树 }; tree *creat(tree *T, int sum)//建立排序二叉树的函数 { ...
2018-09-02 22:51:19
1106
3
原创 希尔排序
#include <bits/stdc++.h> using namespace std; void shersort(int a[], int n) { int i, k, j; for(k = n/2; k>=1; k=k/2)//生成排序间隔数 { for(i = k; i<n; i++) { ...
2018-09-01 22:36:26
247
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人