Given the root of a binary tree
root, return the node values in depth-first order: root — left — right (preorder).Example 1
Input: root = [1]
Output: [1]
Explanation: A tree with one node.
Output: [1]
Explanation: A tree with one node.
Example 2
Input: root = [1,null,2,3]
Output: [1,2,3]
Explanation: Preorder: root, then left and right subtrees.
Output: [1,2,3]
Explanation: Preorder: root, then left and right subtrees.