Difficult:Easy
題目
Given the root of a binary tree, return the inorder traversal of its nodes’ values.
翻譯
給定二叉樹的根,返回其節點值的中序遍歷。
範例
Example 1:
1 | Input: root = [1,null,2,3] |
Example 2:
1 | Input: root = [] |
Example 3:
1 | Input: root = [1] |
解題思路
1.利用遞迴解
Solution
1 | var inorderTraversal = function (root) { |