- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 线索二叉树
BinaryTreeThreading.h#pragma once#include<iostream>using namespace std;enum PointerTag{ LINK, //指针,指向左右孩子 THREAD, //线索,指向前驱或后继};template<class T>struct BinTreThrNode{ BinTreThrNode(co
2015-11-27 16:40:31 294
原创 二叉树的先序,中序,后序遍历
BinaryTree.h#include<iostream>#include<queue>#include<stack>using namespace std;template<class T>struct BinaryTreeNode{ BinaryTreeNode(T value = 0) :_value(value) ,_LeftChild(NULL)
2015-11-22 16:41:33 514
原创 广义表
GeneralList.h#pragma once#include<iostream>using namespace std;enum NodeType{ Head_Type, //头结点 Value_Type, //值节点 Sub_Type, //子表节点};struct GeneralListNode //广义表节点{ NodeType _type
2015-11-20 17:26:43 400
原创 稀疏矩阵的存储,及矩阵的转置
include“Matrix”#pragma once#include<iostream>#include<vector>using namespace std;template<class T>struct Triple{ T _value; size_t _row; size_t _col;};template<class T>class SparseMa
2015-11-13 17:14:11 723
原创 一个数组实现两个栈
#include<iostream>using namespace std;#define LEFT 0#define RIGHT 1template<class T>class DynamicArr{ template<class T> friend class Stack;public: DynamicArr(T* data = NULL) :_cap
2015-11-06 16:59:37 402
原创 求栈的最小值
#include<iostream>#include<stack>using namespace std;#define MAX_DATA 10000000template <class T>class MyStack{ stack<T> s1; //s1数据栈 stack<T> s2; //s2最小值栈public: void Push(const T& x)
2015-11-03 22:12:29 474
原创 迷宫
#include<iostream>#include<stack>using namespace std;#pragma warning(disable:4996)const int N = 5;//从文本中读取迷宫存入数组template<class T>void InitMaze(T** arr){ FILE* f = fopen("maze.txt", "r");
2015-11-03 20:55:48 463
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人