赞
踩
- #include<iostream>
- #include<stdio.h>
- #include<vector>
- #include<map>
- #include<algorithm>
- #include<queue>
-
- using namespace std;
-
- struct TreeNode {
- char val;
- struct TreeNode *left;
- struct TreeNode *right;
-
- TreeNode(char x) :
- val(x), left(NULL), right(NULL) {
- }
- };
-
- TreeNode* make_tree(){
- TreeNode* A = new TreeNode('A'); TreeNode* B = new TreeNode('B');
- TreeNode* C = new TreeNode('C'); TreeNode* D = new TreeNode('D');
- TreeNode* E = new TreeNode('E'); TreeNode* F = new TreeNode('F');
- TreeNode* G = new TreeNode('G'); TreeNode* H = new TreeNode('H');
- TreeNode* K = new TreeNode('K');
- A->left = B;
- A->right = E;
- B->right = C;
- C->left = D;
- E->right = F;
- F->left = G;
- G->left = H;
- G->right = K;
- return A;
- }
- void delet_tree(TreeNode* head){
- if (head ==
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。