[Data Structure]使用非递归的方法对二叉树进行先序、中序、后续遍历
[Data Structure]使用非递归的方法对二叉树进行先序、中序、后续遍历#include<bits/stdc++.h>using namespace std;typedef struct tree//构建一棵树的结点{ int data;//这里的data其实用来放编号了,结点里并没有存数据 tree *left;//指向子树的指针 tree *right;}tree;void LRD(tree* p,int n)//后序遍历函数{
原创
2020-12-18 16:20:18 ·
1245 阅读 ·
1 评论