自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 第2次实验——算法基本功 与 综合思考

(3)算法综合实践——搜索引擎

2014-06-10 16:35:11 510

原创 学生聚类分析思考

我认为自己属于积极主动型,同时也赞同对学生进行分类教育,

2014-06-10 16:17:38 603 1

原创 八皇后及N皇后问题

#include using namespace std; char data[ 8 ][ 8 ]; //chess(double dimensional array) int a[ 8 ]; //column(列) int b[ 15 ]; //主对角线(左上至右下) int c[ 15 ]; //从对角线(右上至左下) int count = 0; void ei

2014-06-10 15:49:29 490

原创 第7周作业1——背包问题

#include using namespace std; #define n 10 void main() { int i,j,k,max,t=0; int a[n]; for(i=0;i<n;i++) { while(1) { a[i]=rand()%100+1; for(j=0;j<i;j++) { if(a[i]==a[j])

2014-04-26 21:07:02 472

原创 第六周作业1——利用哈夫曼编码英文字母表

1. 哈夫曼编码。对教材P167中习题5.18,思考并完成问题a-d。 (下表给出了英文字母(包括用于分割单词的空格)在某文集中的出现频率。 空格      18.3%    |   r        4.8%    |  y       1.6%    e         10.2%   |   d        3.5%   |  p        1.6%  

2014-04-17 22:57:40 823

原创 第四周作业——有向无环图的判断【未完成

用设置visited 数组的方法p输出

2014-04-17 22:32:47 591

原创 第五周作业——有向图邻接表表示及反向图构造

#include #include "stdafx.h" #include #include using namespace std; #define MATRIX_SIZE 44 //存放txt文档数据的数组长度为22*2 = 44 #define VERTEX_NUM 13 //图的顶点数为13 #define EGDE_NUM 22 //边的数目为13 void

2014-04-10 18:41:20 464

原创 第四周作业——无向图的DFS算法【改

DFS算法错了,未完成

2014-04-03 22:38:02 669

原创 第四周作业——图的表示

由于二重指针不能直接指向二维数组,因此此处输出到txt文档的函数不使用指针参数,但出现了乱码,有待研究中 #include #include "stdafx.h" #include #include using namespace std; #define NUM_AMOUNT 26        //有连接边的顶点数为26 #define  VERTEX_NUM 13

2014-04-03 00:33:19 545

原创 第三周作业——顺序查找和二分查找

#include #include "stdafx.h" #include using namespace std; #define PARENT_AMOUNT 10000000 //已知为1000000个数据 #define CHILD_AMOUNT 16 //待查找数据为16个 int getDataFromFile(const char *filename,int *da

2014-03-27 21:59:11 678

原创 第三周作业——冒泡排序和归并排序

#include #include "stdafx.h" #include #include #include #include using namespace std; #define NUM_AMOUNT 10000000 //已知为1000000个数据 /*template int getArrayLen(T& array) { return (sizeof(array)

2014-03-27 21:37:32 600

原创 公开密钥(N,e)的生成算法。

#include #include "stdafx.h" #include using namespace std; int isPrime(long a) { if (a < 0) return -1; else if (a == 1 || a == 2) { return 0; } els

2014-03-20 22:27:19 777

原创 随机生成一个n bit位的长质数

#include #include "stdafx.h" #include using namespace std; //计算2的a次方 int power(int a) { int powNum = 1; for (int i = 0; i < a; i ++) { powNum = 2 * powNum; } return powNum; } int isPrime

2014-03-20 20:09:08 753

原创 随机生成一个n bit位的长整数

#include #include "stdafx.h" #include using namespace std; //计算2的a次方 int power(int a) { int powNum = 1; if (a < 2) return powNum; else { for (int i = 0; i < a; i ++) { powNum = 2 * p

2014-03-20 01:04:44 726

原创 判断一个正整数是否为质数的算法

#include #include "stdafx.h" using namespace std; int isPrime(long a) { if (a < 0) return -1; else if (a == 1 || a == 2) { return 1; } else if(a == 0) { return 0; } else { if ((a%

2014-03-19 23:02:56 756

原创 算法概论思维导图

本次思维导图虽然只是简单地将课本内容浏览了一遍,但对整本书地教学结构有了一个大概的认识,再加上本书内容与之前所学的数据结构有所相同,所以也较快完成,但是其实本书的内容也比以前所学的数据结构有所加深,因此还需要重新认识并深入理解这门课程。

2014-03-12 22:25:31 979 2

原创 求两个正整数的最大公约数

原代码:int gcd(int m, int n){ if(m < n){ int tmp = m; m = n; n = tmp } if(n == 0) return m; else return gcd(n, m%n); }完善后代码: #include using namespace std;

2014-03-12 10:39:30 669 2

空空如也

空空如也

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

TA关注的人

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