摘要:
#include "stdafx.h"#include <iostream>#include <fstream>#include <queue>using namespace std;typedef struct _Node{ int data; struct _Node *left; struct _Node *right; _Node() { data = 0; left = NULL; right = NULL; }}Node, *_PNode;//创建二叉树利用先序创建/* ... 阅读全文
posted @ 2012-08-24 22:15
venow
阅读(306)
评论(0)
推荐(0)
摘要:
#include "stdafx.h"#include <iostream>#include <fstream>using namespace std;typedef struct _Node{ int data; struct _Node *left; struct _Node *right; bool isVisit; //后序遍历标志(非递归) _Node() { data = 0; left = NULL; right = NULL; isVisit = false; }}... 阅读全文
posted @ 2012-08-24 21:31
venow
阅读(1647)
评论(0)
推荐(0)
摘要:
题目:输入一个整数和一棵二元树,从树的根结点开始往下访问一直到叶结点所经过的所有结点形成一条路径。打印出和与输入整数相等的所有路径。答:二叉树的后序非递归遍历#include "stdafx.h"#include <iostream>#include <fstream>#include <queue>using namespace std;typedef struct _Node{ int data; struct _Node *left; struct _Node *right; bool isVisit; //后序遍历标志(非递归) 阅读全文
posted @ 2012-08-24 21:01
venow
阅读(308)
评论(0)
推荐(0)
浙公网安备 33010602011771号