Recursive inorder travel solution
// recursive inorder travel \n    int kthSmallest(TreeNode* root, int k) {\n        int iRet = 0;\n        dfs(root, iRet, k);\n        return iRet;\n    }\n   
    // recursive inorder travel \n    int kthSmallest(TreeNode* root, int k) {\n        int iRet = 0;\n        dfs(root, iRet, k);\n        return iRet;\n    }\n    \n    void dfs(TreeNode *root, int &iRet, int &k) {\n        if (!root || k <= 0) return;\n        \n        dfs(root->left, iRet, k);\n        \n        if (k <= 0) return;\n        --k;\n        if (k == 0) { iRet = root->val; return;}\n        \n        dfs(root->right, iRet, k);\n    }
[]