
算法
文章平均质量分 78
MrLeaper
这个作者很懒,什么都没留下…
展开
-
最小飞机换乘(Dijkstra)
#include#include#include#include#include#include#include using namespace std;int INF=9999999;templateclass MGraph{public: MGraph(int mSize); ~MGraph(); bool Insert(int u,int原创 2017-05-26 21:03:04 · 608 阅读 · 1 评论 -
基于Python的机器学习实战:Apriori
1.关联分析 关联分析是一种在大规模数据集中寻找有趣关系的任务。这种关系表现为两种形式:1.频繁项集(frequency item sets):经常同时出现的一些元素的集合;2.关联规则(association rules): 意味着两种元素之间存在很强的关系。下面举例来说明上面的两个概念:表1 一个来自Hole Foods天食品店的简单交易清单转载 2017-05-31 18:56:02 · 437 阅读 · 0 评论 -
动态规划-硬币问题
问题描述:输入总金额n,硬币不同价值的种类m,m种硬币的面值; 例如:15 61 2 7 8 12 50 输出凑成n最少的硬币数(1)贪心算法:每次都选择面值最大的。问题在于,求出来的并不是最优解,上例中,用贪心解出来的结果为3(1,2,12),而实际为2(7,8)#include #include using namespace std;原创 2017-05-20 16:05:21 · 1544 阅读 · 0 评论 -
matlab写入txt、excel 以及关于图的处理
clc,clearfid1=fopen('x.txt','w');fid3=fopen('x1.txt','w');x=[1 1 2 3 3 4 4 5 5 6 7 7 8 8 9 10 11 11 12 14 15 15 16 16 17 17 17 18 18 19 20 21 22 23 24 24 25 26 26 27 28 28 29 30 30 31 31 32 33 3原创 2017-08-09 16:56:19 · 2027 阅读 · 0 评论 -
图的基本操作(遍历,寻找最短路径,最小生成树)
#include#include#include#include#include#include#include using namespace std;int INF=9999999;templateclass MGraph{public: MGraph(int mSize); ~MGraph(); bool Insert(int u,int原创 2017-05-23 15:17:23 · 596 阅读 · 0 评论