100 percent faster || easy to understand
class Solution {\n    private : vectorres;\n    void preorder(TreeNode root, vector&res)\n    {\n        if(root==NULL)\n            return;\n        res.push_b
class Solution {\n    private : vector<int>res;\n    void preorder(TreeNode *root, vector<int>&res)\n    {\n        if(root==NULL)\n            return;\n        res.push_back(root->val);\n        preorder(root->left,res);\n        preorder(root->right,res);\n        return;\n    }\npublic:\n    vector<int> preorderTraversal(TreeNode* root) {\n        \n        preorder(root,res);\n        return res;\n        \n    }\n};
['C']