原创 各種圖的創建以及廣度,深度優先遍歷(臨接矩陣存儲)
#include <stdio.h> #include <iostream> #include <limits.h> #include <queue> #define INFINTY INT_MAX //最大值 #def
原创 Java版貪喫蛇(比較完善的版本)
很認真的寫的一個java版的貪喫蛇遊戲,圖形界面,支持菜單操作,鍵盤監聽,可加速,減速,統計得分,設定運動速度,設定遊戲背景顏色等!應該沒有Bug了,因爲全被我修改沒了。哈哈。 下面是項目各包及類的層次關係: 遊戲的主要運行界面截圖如下
原创 矩陣旋轉(左旋,右旋)
#include <iostream> using namespace std; const int M = 3; //行數 const int N = 5; //列數 int main() { int a[M][N] = {{
原创 文件下載示例
文件所在位置:/DownLoadDemo/WebRoot/download/001.jpg ///DownLoadDemo/src/com/huowolf/DownLoadServlet.java package com.huowolf;
原创 最小生成樹算法(1)-----------prim
#include <iostream> #include <iomanip> using namespace std; #define MaxVertexNum 100 //最大頂點數 #define INFINTY 655
原创 求一個數的相反數的補碼
1.已知8位二進制表示的整數X的補碼爲10011011,則-X的補碼的二進 制編碼爲( 01100101 )。 解析:已知x和-x的反碼是互爲相反的,所以已知x的補碼,[x]反 = [x]補 - 1, (x爲負數) 那麼-x(-x
原创 單源最短路徑----Dijkstra算法
#include <iostream> #include <vector> #define INFINITY 32768 #define VERTEX_MAX 50 using namespace std; typedef char V
原创 萬年曆(C語言版)
#include <stdio.h> //判斷輸入的年份是否是閏年 int IsLeap(int year) { if((year%400==0) || ((year%4==0)&&(year%100!=0))) return
原创 Properties示例
package com.huowolf; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java
原创 圖的創建,深搜,廣搜(基於臨接表實現)
#include <stdio.h> #include <stdlib.h> #include <iostream> #include <queue> using namespace std; #define MaxVertexNum
原创 實現C語言字符串操作的庫函數
#include <stdio.h> //求字符串串長(版本一) //用字符數組實現 int mystrlen1(char s[]) { int len = 0; while(s[len] != '\0') { len++;
原创 截取字符串實例
#include <stdio.h> //通過指針函數返回一個截完的串的地址 char *substring(char s[],int i,int j) { //這個臨時數組必須是static,否則值傳不回去 static ch
原创 循環隊列(C語言版)
<pre name="code" class="cpp">#include <iostream> using namespace std; #define MAXSIZE 50 typedef int QueueElementType;
原创 MD5工具類
package com.huowolf.Util; import java.security.MessageDigest; import sun.misc.BASE64Encoder; public class MD5Util {
原创 循環鏈表
//帶頭節點 #include <iostream> using namespace std; typedef int ElemType; typedef struct Node { ElemType data; str