思路 典型的层次遍历,套模板即可。 代码实现 /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ //其实就是树的层次遍历 class Solution { public: vector<int> PrintFromTopToBottom(TreeNode* root) { vector<int>ans; q...