Given the root node of a binary tree, return a list containing the values of the nodes in inorder traversal (left subtree, root, right subtree). The input is provided as a TreeNode object. If the tree is empty, return an empty list.
Example 1
Input: TreeNode(5, TreeNode(3), TreeNode(7))
Output: [3, 5, 7]
Explanation: Inorder traversal: left (3), root (5), right (7).
Example 2
Input: TreeNode(10, None, TreeNode(20, TreeNode(15), None))
Output: [10, 15, 20]
Explanation: Inorder traversal: root (10), left subtree is None, right subtree (15, 20).
Example 3
Input: None
Output: []
Explanation: Empty tree returns empty list.
Example 4
Input: TreeNode(1, TreeNode(0), None)
Output: [0, 1]
Explanation: Inorder traversal: left (0), root (1), right is None.
Constraints
Case 1
Input: TreeNode(8, TreeNode(4, None, TreeNode(6)), TreeNode(12))
Expected: [4, 6, 8, 12]
Case 2
Input: TreeNode(2, TreeNode(1), TreeNode(3))
Expected: [1, 2, 3]
Case 3
Input: TreeNode(9, None, TreeNode(10, None, TreeNode(11)))
Expected: [9, 10, 11]
Case 4
Input: TreeNode(0)
Expected: [0]