C++ | In Order Traversal | Easy
\nclass Solution {\npublic:\n    int ans = 0, kg, c = 1;\n    void inOrder(TreeNode* root) {\n        if(root){\n            inOrder(root->left);\n            i
```\nclass Solution {\npublic:\n    int ans = 0, kg, c = 1;\n    void inOrder(TreeNode* root) {\n        if(root){\n            inOrder(root->left);\n            if(c == kg)\n                ans = root->val;\n            c++;\n            inOrder(root->right);\n        }\n    }\n    int kthSmallest(TreeNode* root, int k) {\n        kg = k;\n        inOrder(root);\n        return ans;\n    }\n};\n```\n**Do upvote if you liked it**
['Recursion', 'C']