1020 Tree Traversals

題目大意: 給你二叉樹結點數和後序,中序遍歷結果,要求輸出層次遍歷的結果。 解題思路: 二叉樹板子題,根據後序中序構建二叉樹,然後通過BFS遍歷輸出層次序列即可。 代碼如下: #include<iostream> #include<cstdio> #include<fstream> #include<set> #include<cmath> #include<cstring> #include<s
相關文章
相關標籤/搜索