原创 第九章第14題(趕出來的作業) POWERBY KTL
//第九章第14題;//假設十個符號爲ABCDEFGHIJ,權值爲8,21,37,24,6,18,23,41,56,14;//輸入權值:8回車;//輸入數據:A(不用回車);//輸入十個權值和數據後,輸出爲:A 11001 ;B 1011
原创 第八章十六題修改後POWERBY KTL
#include "stdio.h"#include "stdlib.h"#include "string.h"#include "conio.h"#define M 10typedef char datatype; typedef st
原创 第九章第十七題(趕出來的作業) powerby ktl
//第九章第17題;用非遞歸算法設計先序遍歷二叉樹;#include "stdio.h"#include "conio.h"#include "stdlib.h"#define N 15 //需要設置棧的最大值,若二叉樹深度爲四,則設
原创 第10章第16題完整代碼(cpp) (Powered by biggates)
/// 10_16 利用圖的深度優先搜索和廣度優先搜索各寫一個算法, /// 判別以鄰接表方式表示的有向圖中是否存在由頂點 /// vi到頂點vj的路徑(i!=j) #include "stdafx.h" #include <std
原创 第八章十一題,修改了 ,用單鏈表實現str.(不好意思又看錯條件了,這次沒有錯誤了。)powerby KTL
#include "stdio.h"#include "stdlib.h"#include "string.h" typedef char datatype; typedef struct node{ datatype data; str
原创 第10章第16題定義(h) (Powered by biggates)
/// Chapter10.h: 第十章的結構定義和函數聲明 const int NUM_OF_VEX = 8; //頂點數 //以下是鄰接矩陣的定義 typedef struct graphArr
原创 第就章第21題(趕出來的作業) POWERBY KTL
//第九章第21題,交換左右子樹;//輸入參考書本p194,圖9-8,輸入爲ABCDEFG@@@@L@@@#;中序遍歷結果應該爲DBEALFCG;//交換左右子樹後進行中序遍歷的結果應爲:GCFLAEBD;//可以用別的二叉樹進行驗證;若
原创 第七章20題關鍵代碼
typedef struct linknode{ char data; struct linknode *pNext;}linkstring; void MyChange(linkstring * S,char c,char s){ wh
原创 第8章十一題關鍵函數
#include "stdio.h"#include "stdlib.h"#include "string.h" typedef char datatype; typedef struct node{ datatype data; str
原创 第七章第19題關鍵代碼
typedef struct{ char str[MAX]; int len;}seqstring; void MyDelete(seqstring* s,int i,int j){ int k,h; if(i+j-1>s->len)
原创 第六章21全部代碼(powered by spirit_only)
1 // 2 //6_21線性表逆置 3 // 4 #include <stdio.h> 5 #include <stdlib.h> 6 typedef int datatype;
原创 第七章26題關鍵代碼
spmatrix *Chen(spmatrix *a,spmatrix *b){ int ano,bno,cno,col; spmatrix * c; c=InitSpmatrix(a->m,b->n,(a->m)*(b->n)); c-
原创 第八章十六題關鍵代碼,輸出的時候有些問題,主要看算法。
#include "stdio.h"#include "stdlib.h"#include "string.h"#include "conio.h"#define M 10typedef char datatype; typedef st
原创 第九章17題power by spirit_only
// 9_17_main.cpp : 二叉樹的非遞歸先序遍歷 // #include "stdafx.h" #include <conio.h> #include <stdlib.h> //數據結構定義及全局常量定義 int const
原创 第六章31題全部代碼(powered by spirit_only)
1 // 2 //6_31字符分類 3 // 4 #include <stdio.h> 5 #include <stdlib.h> 6 typedef char datatype;