- 博客(10)
- 收藏
- 关注
原创 第一次实验——八皇后问题
#include int count =0; int notDanger(int row,int j,int (*chess)[8]) { int i,k,flag1=0,flag2=0,flag3=0,flag4=0,flag5=0; for(i=0;i<8;i++) { if(*(*(chess+i)+j)!=0) { flag1 =1; break
2014-06-10 19:09:50 690
原创 第二次实验-----算法基本功与综合思考
腾讯面试题 有A、B、C、D四个人,要在夜里过一座桥。他们通过这座桥分别需要耗时1、2、5、10分钟,只有一支手电,并且同时最多只能两个人一起过桥。请问,如何安排,能够在17分钟内这四个人都过桥?
2014-06-10 15:43:21 687
原创 第七周作业——最长递增子序列
#include "stdafx.h" #include "string.h" #include using namespace std; enum decreaseDir {kInit = 0, kLeft, kUp, kLeftUp}; void LCS_Print(int **LCS_direction, char* pStr1, char*
2014-04-24 09:17:17 811
原创 第六周作业——哈夫曼编码
利用哈夫曼编码定义,可得出哈夫曼编码为: z:1111011000 q:1111011001 x:1111011010 j: 1111011011 k:11110111 v:1111010 b:100100 p:100101 y:111100 g:101100 f:101101 w:111110 m:111111
2014-04-24 09:11:19 741
原创 第五周作业——有向图邻接表表示及反图构造
package t5f1; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.Reader; public class GraphReverse { public static int V=0,E=0; public static voi
2014-04-21 21:02:04 728
原创 第四周作业
package my.resources; import java.io.File; import java.io.PrintWriter; import java.util.Scanner; public class GraphRepresentation { private int[] G = new int[2]; private int[][
2014-04-09 14:01:18 643
原创 第三周作业
第三周作业——冒泡排序和归并排序 #include #include #include using namespace std; 冒泡 //Bubble sort void bubbleSort() { int Text[10000000]; int j; int k; int Transit; int i = 0; ifstream fileInput; fstr
2014-04-02 22:48:25 524
原创 RSA算法作业
#include #include int main(void) { int m=2;int n;int goon=1; do { printf("");scanf("%d",&n); }while(nisPrime(n); int isPrime(int a){ int n2=sqrt(a); while(goon==1 &&m<=n2) { if(n%m==0)go
2014-03-20 12:57:41 791
原创 计算两个数的最大公约数
201111621310 public static int get max(int a,int b) { if(a>b) { int temp; temp = a; a=b; b = temp; if(b==0) { return a; } 修改后的程序 public static int get
2014-03-12 12:54:43 930
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人