102. 二叉樹的層次遍歷

題目: 題解: 思路:遞歸,追蹤樹的層次。 代碼: var levelOrder = function (root) { var res = [] let index = 0; travel(root, index) function travel(roots, index) { if (roots) { if (!res[
相關文章
相關標籤/搜索