C# with recursion
\npublic class Solution {\n  public int KthSmallest(TreeNode root, int k) {\n\n    IEnumerable<int> traverse(TreeNode r) {\n      if (r != null) {\n        fore
```\npublic class Solution {\n  public int KthSmallest(TreeNode root, int k) {\n\n    IEnumerable<int> traverse(TreeNode r) {\n      if (r != null) {\n        foreach(var n in traverse(r.left)) yield return n;\n        yield return r.val;\n        foreach(var n in traverse(r.right)) yield return n;\n      }\n    }\n    \n    return traverse(root).ElementAt(k-1);\n    \n  }\n}\n```
[]