二叉树的层次遍历(BFS)从最后一层开始输出
#include <iostream>#include<bits/stdc++.h>using namespace std;struct TreeNode{ TreeNode *left; TreeNode * right; int val; TreeNode(int x):val(x),left(NULL),right(NULL) {} //TreeNode(int x) : val(x), left(NULL), right(NULL
原创
2021-03-08 21:08:36 ·
251 阅读 ·
0 评论