Java easy solution 0ms 100% faster || Recursion
Code\n\njava\npublic List<Integer> preorderTraversal(TreeNode root) {\n\tList<Integer> list = new ArrayList<>();\n\tpreorder(root, list);\n\treturn list;\n}\n\n
**Code**\n\n```java\npublic List<Integer> preorderTraversal(TreeNode root) {\n\tList<Integer> list = new ArrayList<>();\n\tpreorder(root, list);\n\treturn list;\n}\n\npublic void preorder(TreeNode root, List<Integer> list) {\n\tif(root == null) return;\n\n\tlist.add(root.val);\n\tpreorder(root.left, list);\n\tpreorder(root.right, list);\n}\n```\n\nHope it helps\nDo upvote\nThanks
['Recursion', 'Java']