摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <Windows.h>using namespace std;#define INFINITY 65535#define MAX_VERTEX_NUM 20 //顶点最多个数#define LENGTH 5 //顶点字符长度//*********************************邻接表***********************************begintypedef char Vert 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <Windows.h>#include <algorithm>using namespace std;#define INFINITY INT_MAX#define MAX_VERTEX_NUM 20 //顶点最多个数#define LENGTH 5 //顶点字符长度//********************************Kruskal(并查集实现)******************* 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <queue>#include <stack>#include <Windows.h>using namespace std;#define INFINITY INT_MAX#define MAX_VERTEX_NUM 20 //顶点最多个数#define LENGTH 5 //顶点字符长度//邻接矩阵typedef struct _Graph{ int matrix[MAX_VERTE 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <queue>#include <Windows.h>using namespace std;#define INFINITY INT_MAX#define MAX_VERTEX_NUM 20 //顶点最多个数#define LENGTH 5 //顶点字符长度//邻接矩阵typedef struct _Graph{ int matrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM] 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <Windows.h>using namespace std;typedef struct _Node{ int data; struct _Node *left; struct _Node *right; bool isRed; //红黑树 _Node() { data = 0; left = NULL; right = NULL; isRed = true; }}Node, *_PN... 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <queue>#include <Windows.h>using namespace std;#define INFINITY INT_MAX#define MAX_VERTEX_NUM 20 //顶点最多个数#define LENGTH 5 //顶点字符长度//*********************************邻接表********************************* 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <queue>#include <Windows.h>using namespace std;#define INFINITY INT_MAX#define MAX_VERTEX_NUM 20 //顶点最多个数#define LENGTH 5 //顶点字符长度//邻接矩阵typedef struct _Graph{ int matrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM] 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <iomanip>#include <stack>#include <queue>#include <Windows.h>using namespace std;typedef struct _Node{ int data; struct _Node *left; struct _Node *right; int bf; //平衡因子 _Node() { data = 0; left = NULL; ... 阅读全文
摘要:
一般我们说虚函数,它的访问级别都是public的,用类对象可以直接调用,这样就可以实现运行时的类型绑定,那如果我们将虚函数私有化会出现什么情况呢?我们先来看一个非虚函数私有化的例子class Base{private: void PrintClassName () { cout<<"Base"<<endl; }public: void print() { PrintClassName(); }};class Derived : public Base{private: void PrintClassName() { ... 阅读全文
摘要:
#include "stdafx.h"#include <iostream>#include <iomanip>#include <stack>#include <queue>#include <Windows.h>using namespace std;enum TYPE{ TYPE_LINK = 0, TYPE_CLUES,};typedef struct _Node{ int data; struct _Node *left; struct _Node *right; bool isVisit; //用于后序 阅读全文