- 博客(1)
- 收藏
- 关注
原创 根据后序遍历和中序遍历求二叉树的层序遍历
思路:用递归把中序遍历的数组划分为左右子树部分,直到没有左右子树(叶子节点)。层序遍历的方法:使用队列。#include <iostream>#include<vector>#include<queue>using namespace std;#define maxsize 30typedef struct node* T;struct node { int data; T left; T right;};int n, postorder[ma
2021-09-24 12:51:13
618
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人