/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; 利用两个stack,来回保存下一层的节点,并且在各自的循环过程中进行出栈处理,就可以实现规定的之字输出; 突破点:两个stack在同一个循环中前后顺序作为一个整体循环。 * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * }; */ class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方...