自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Kruscal算法的C++实现

#include #include #include #include using namespace std;int mst = 0;struct edge { int u, v, w;};edge edges[10000];int index[10000];int find(int x){ if (index[x] == x) { return ind

2017-09-13 23:16:08 776 1

原创 最长公共子序列(LCS)的C++实现

首先有如下递归式绘制图表如下首先我们实现最长公共子序列长度的输出,代码如下:#include#include#include#includeusing namespace std;int table[100][100] = { 0 };int main(){ string a, b; cin >> a >> b; int m = a.length(); i

2017-07-26 22:09:41 4771

原创 算法导论例题——钢管切割

算法导论》(CLRS)中第一个dp例题(rodcutting)的C++代码#include#include#includeusing namespace std;int main(){ int price[11] = { 0,1,5,8,9,10,17,17,20,24,30 }; int n; cin >> n; vector table(n+1,0); for (int i =

2017-07-26 17:56:43 3520

空空如也

空空如也

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

TA关注的人

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