自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 Prime算法和Krustal算法(转自博客园华山大师兄)

Prim算法1.概览普里姆算法(Prim算法),图论中的一种算法,可在加权连通图里搜索最小生成树。意即由此算法搜索到的边子集所构成的树中,不但包括了连通图里的所有顶点(英语:Vertex (graph theory)),且其所有边的权值之和亦为最小。该算法于1930年由捷克数学家沃伊捷赫·亚尔尼克(英语:Vojtěch Jarník)发现;并在1957年由美国计算机科学家罗

2016-01-04 03:31:32 6568

转载 贪心算法(转载自博客园)

贪心算法 以下参照一张清华PPT课件  1.定义概览贪心算法(又称贪婪算法)是指,在对问题求解时,总是做出在当前看来是最好的选择。也就是说,不从整体最优上加以考虑,他所做出的仅是在某种意义上的局部最优解。贪心算法不是对所有问题都能得到整体最优解,但对范围相当广泛的许多问题他能产生整体最优解或者是整体最优解的近似解。贪心算法在有最优子结构的问题中尤为有效。最优

2016-01-04 03:29:23 456

转载 转载自博客园

Dijkstra算法1.定义概览Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法是很有代表性的最短路径算法,在很多专业课程中都作为基本内容有详细的介绍,如数据结构,图论,运筹学等等。注意该算法要求图中不存在负权边。问题描述:在无向图 G=(V,E) 中,假

2016-01-04 03:27:10 744

原创 作业5.19

#include #include using namespace std;class base{public: base(string name1,int age1) { name=name1; age=age1; } void showdata() { cout<<"相关信息如下:"<<endl; cout<<"姓名:"<<nam

2015-05-09 01:10:58 466 1

原创 作业5.18

#include #include using namespace std;class person{public: person(int num1, string name1) { num=num1; name=name1; } void showdata() { cout<<"编号:"<<num<<endl; cout<<"姓名:"<

2015-05-08 23:28:03 367 1

原创 作业4.21

#include #include using namespace std;class student{private: int number; string name; float score; static int sum; static float total; static float average;public: student(int

2015-04-16 23:35:13 596 1

原创 作业4.18

#include using namespace std;class Student{public: Student(); void get_stu(); void max(Student *s);private: int number; int score;};Student::Student(){}void Student::get_

2015-04-16 23:27:32 427 1

原创 作业4.20

#include using namespace std;class book{private: int price; int qu;public: book(int q); int show();};book::book(int q){ qu=q; price=q*10;}book::show(){ return price*q

2015-04-16 23:17:09 595 1

原创 作业4.19

#include using namespace std;class book{private: int price; int qu;public: book(int q); int show();};book::book(int q){ qu=q; price=q*10;}book::show(){ return price*q

2015-04-16 23:16:12 467 1

原创 作业 4.17

#include using namespace std;class Student{public: Student(); void get_stu(); void show();private: int number; int score;};Student::Student(){}void Student::get_stu(){

2015-04-16 11:08:50 517 1

原创 P121 4

#include using namespace std;class Student{private: float score; static float total_score; static int count;public: void account(float); static float sum(); static float average

2015-04-15 23:04:14 574 1

原创 P121 3

#include #include using namespace std;class Location{public: Location(double,double);//构造函数 double Getx();//成员函数,取x值 double Gety();//成员函数,取y值 double distance(Location&); friend do

2015-04-15 22:21:32 661 1

原创 第三章作业3.24

#includeusing namespace std;class Date{public: void printdate();//显示日期 int getyear();//取年的值 int getmonth();//取月的值 int getday ();//取日的值 void setdate(int y,int m ,int d);//设置日期值 Date

2015-04-01 23:26:05 597 3

原创 第三章作业3.23

#include using namespace std;class cylinder{private: double radius, height, volume;public: cylinder(int rad, int hei);//构造函数原型说明 double getVol(); void vol();};cylinde

2015-04-01 21:30:13 648 1

原创 第三章作业3.22

#include using namespace std;class Circle {private: double radius;public: double area(double rad);};double Circle::area(double rad){ cout<<"圆的面积是:"<<3.14*rad*rad<<endl; return 3

2015-04-01 21:24:53 546 1

空空如也

空空如也

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

TA关注的人

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