C# - iterative with Stack
public IList<int> PreorderTraversal(TreeNode root) {\n        Stack<TreeNode> stack = new Stack<TreeNode>();\n        List<int> list = new List<int>();\n       
    public IList<int> PreorderTraversal(TreeNode root) {\n        Stack<TreeNode> stack = new Stack<TreeNode>();\n        List<int> list = new List<int>();\n        stack.Push(root);\n        while (stack.Count() > 0)\n        {\n            TreeNode current = stack.Pop();\n            if (current != null)\n            {\n                list.Add(current.val);\n                stack.Push(current.right);\n                stack.Push(current.left);\n            }\n        }\n        \n        return list;\n    }
[]