摘要:
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Note:Recursive solution is trivial, could you do it iteratively?Code:1. Recursive:class Solution {public: void findNode(vector &nodes,TreeNode *node){... 阅读全文