自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 快速幂和快速矩阵

#include using namespace std; #include const int INF=3; typedef struct node { int m[INF][INF]; }Matrix; Matrix P={2,3,4,4,5,6,4,5,3}; Matrix I={1,0,0,0,1,0,0,0,1}; Matrix multy(Matrix a,

2016-01-27 15:22:34 252

原创 KMP算法

KMP算法 #include #include #include using namespace std; const int INF=0x7fff; int p[INF]; //ababacb // void findB(string str) { int len=str.length(); string strcopy(len+1,0); strco

2016-01-26 14:32:07 257

原创 Prime最小生成树

#include #include #include using namespace std; int graph[8][8]; #include bool visited[8]; int dis[8]; int pre[8]; const int minn=127; void prim(int n) { memset(visited,false,s

2016-01-24 12:07:05 343

原创 SPFA随手写,容易理解的

对应的图是 // spfa.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include using namespace std; int graph[8][8]; #include bool v

2016-01-23 20:32:44 250

八皇后问题

八皇后问题

2013-06-05

西北工业大学数据结构课程设计报告(代码+报告)

这份报告老师给的分数是95哦,用了哈希散列,学弟学妹可以参考下

2013-02-24

矩阵连乘的C++代码

在科学计算中经常要计算矩阵的乘积。矩阵A和B可乘的条件是矩阵A的列数等于矩阵B的行数。若A是一个p×q的矩阵,B是一个q×r的矩阵,则其乘积C=AB是一个p×r的矩阵。计算C=AB总共需要p×q×r次乘法。 现在的问题是,给定n个矩阵{A1,A2,…,An}。其中Ai与Ai+1是可乘的,i=1,2,…,n-1。 要求计算出这n个矩阵的连乘积A1A2…An最少需要多少次乘法。 输入 输入数据的第一行是一个整树n(0 < n ≤ 10),表示矩阵的个数。 接下来的n行每行两个整数p,q( 0 < p,q < 100),分别表示一个矩阵的行数和列数。 输出 输出一个整数:计算连乘积最少需要乘法的次数。输出后需换行

2013-02-12

空空如也

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

TA关注的人

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