text: // Very classical algorithm for binary tree traversal using recursion.
  // inorder: left root right
  // preorder: root left right
  // postorder: left right root
  /**
   * Definition for a binary tree node.
   * struct TreeNode {
   *     int val;
   *     TreeNode *left;
   *     TreeNode *right;
   *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
   * };
   */
  class Solution {
  public:
      vector<int> res;
      vector<int> inorderTraversal(TreeNode* root) {
          if (root){
              inorderTraversal(root->left);
              res.push_back(root->val);
              inorderTraversal(root->right);
          }
          return res;
      }
  };
  