FromLeetcodeStatusACDateJul 10, 2023Tags栈树深度优先搜索二叉树Difficulty简单Linkhttps://leetcode.cn/problems/binary-tree-preorder-traversal/描述给你二叉树的根节点 root ,返回它节点值的 前序 遍历。示例 1:``` 输入:root = [1,null,2,3] 输出:[1,2,3]输入:root = [] 输出:[]输入:root = [1] 输出:[1]示例 5:``` 输入:root = [1,null,2] 输出:[1,2]思路递归法代码