自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 单源最短路经的迪杰斯特拉算法(Dijkstra)

/* Theme:单源最短路经的迪杰斯特拉算法(Dijkstra) Author:liu date:2018/6/6 */ /* 解题步骤: 1.将源点加入顶点集V,边集E为空 2.选择与顶点V中相连出去的图中最短的路径,加入E集合,新的顶点加入V集合 3.重复步骤2,知道所有顶点都在集合V中 */ #include<iostream> using namespace std; #...

2018-06-06 21:17:35 906

原创 idea中使用junit生成测试文件过程遇到的问题

之后出现之后网上找了很多方法但是都不行,后来在做其他事的时候发现自己的idea的class template模版是空的按照网上方法修改以后,再去试了试原先的问题(因为测试文件也是生成class),然后……就可以了\\\\\\hahahahahah...

2018-02-27 16:12:49 3530

原创 关键路径(AOE)—基于拓扑排序(AOV)

数据结构讲到图的部分,实现一些比较经典的算法。测试数据是网上提供的。 关键路径的实现基于拓扑排序,同时用到了栈结构。//Stack.h #ifndef STACK_H #define STACK_Hclass Stack{ public: Stack(int n = 10); bool push(int a); int pop(); bool isfull();//判

2017-12-04 18:51:47 801 1

原创 拓扑排序

//Stack.h #ifndef STACK_H #define STACK_Hclass Stack{ public: Stack(int n = 10); bool push(int a); int pop(); bool isfull();//判断是否满 bool isempty(); private: int size;//表示最大容量

2017-11-30 19:42:46 182

原创 最小生成树--Prim--C++

//PRIM.h #ifndef PRIM_H #define PRIM_Hstruct Ass{ int value; int index;//储存已经选好的点与数组下标的边是最小的 };class MGraph{ public: int Vex; int **value; MGraph(int n=0); bool Inition(); }; cla

2017-11-30 09:34:04 272

原创 自测04——Have Fun with Numbers

题目: Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit n

2017-11-04 23:12:49 235

原创 自测05—Shuffling Machine(自动洗牌机)

题目: Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate wit

2017-11-03 23:00:15 361

原创 自测03—数组元素循环右移问题

题目:一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置, 即将A中的数据由(A​0​​A​1​​⋯A​N−1​​)变换为(A​N−M​​⋯A​N−1​​A​0​​A​1​​⋯A​N−M−1​​)(最后M个数循环移至最前面的M个位置)。 如果需要考虑程序移动数据的次数尽量少,要如何设计移动的方法? 要移动数据次数最少,而且不允许使用另外数组,

2017-11-01 23:06:57 222

原创 自测02—素数对猜想

includeusing namespace std;define MAXLENGTH 50000int main(){ int a[MAXLENGTH]; int flag, n; a[0] = 2; for (int i = 1, k = 3;k<=2*MAXLENGTH; k++){ flag = 1;//flag赋值要在外面,如果是

2017-10-31 22:56:42 128

原创 自测01—打印沙漏

//沙漏 #include<iostream> #include<math.h> using namespace std;int main(){ int i,g=0,m; char c; cin >> i >> c; int j = sqrt((i + 1) / 2); m =i-( 2 * j*j - 1); for (int k = j; k>=

2017-10-31 22:17:17 529

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除