
数据结构
DeathYmz
划水摸鱼要不得!!!
不上紫名不改简介=_=(改了改了 打leetcode周赛去了 codeforces太晚了养身要紧)
展开
-
先序遍历,中序遍历:最后层次右到左输出。
先序遍历:根左右 中序遍历:左根右 后序遍历:左右根 给出先序遍历和中序遍历,从右到左层次输出 指针版本: #include<iostream> #include<cstdio> #include<algorithm> #include<queue> using namespace std; int pre_n[50]; int in_n...原创 2019-03-23 18:17:41 · 424 阅读 · 0 评论 -
二叉树的先序/中序/后序遍历,以及根据中序+先序/后序 遍历推导整个树
二叉树遍历: 先序遍历:根左右 中序遍历:左根右 后序遍历:左右根 给出中序遍历 +先序遍历/后序遍历 输出整个树的层次遍历左到右的结果: #include<iostream> #include<cstring> #include<cstdio> #include<queue> using namespace std...原创 2019-07-30 21:36:59 · 350 阅读 · 0 评论