赞
踩
源码:
#include<queue> #include<stack> #include<vector> #include<iostream> using namespace std; //假设空节点的值为-1 //const int arrrlens = 18; //char arr[arrrlens] = { 'A', 'B', 'D' , '#', 'H', '#', '#', 'E', '#', '#',\ 'C', 'F' , '#', '#', 'G', '#', '#'}; //A B D # H # # E # # C F # # G # # class Node { public: Node(int el = 0, Node * l = NULL, Node * r = NULL) { data = el; mark = 0; left = l; right = r; } char data; int mark; Node* left, * right; }; class Tree { public: Tree() {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。