随笔分类 -  算法--数据结构

摘要:#include<iostream>#include <iomanip>#include <stack>#include <deque>#include <fstream>using namespace std;struct primnode{public:char begvex;char endvex;int lowcost;};struct adknode{ int dist;//最近距离char way[50];//顶点数组int nodenum;//经过的顶点数};class Mgraph//邻接矩阵储存结构{public:M 阅读全文
posted @ 2010-12-29 22:36 AningEmpire 阅读(2100) 评论(0) 推荐(2)
摘要:#include <iostream>#include <deque>#include <stack>using namespace std;struct BSTNode{int data;BSTNode * LChild,* RChild;};class BST{private:BSTNode *T;public:~BST();BSTNode * GetRoot();void BSTCreate();void BSTInsert(BSTNode *);int BSTDepth(BSTNode *);//求树的深度 递归void Depth();//树的深度 阅读全文
posted @ 2010-12-28 12:58 AningEmpire 阅读(4093) 评论(1) 推荐(0)
摘要:#include<iostream>#include <iomanip>#include <string>#include<deque>using namespace std;const int MAXSIZE=20;class node {public:void operator =(node b);int key;char info;};void node::operator=(node b){key=b.key;info=b.info;}struct Sqlist{node data[MAXSIZE+1];int length;};clas 阅读全文
posted @ 2010-12-28 09:20 AningEmpire 阅读(445) 评论(0) 推荐(1)