Pythonic approach with generator
With generator in python, one very straightforward solution might be:\n\n    class Solution:\n        # @param {TreeNode} root\n        # @param {integer} k\n  
With generator in python, one very straightforward solution might be:\n\n    class Solution:\n        # @param {TreeNode} root\n        # @param {integer} k\n        # @return {integer}\n        def kthSmallest(self, root, k):\n            for val in self.inorder(root):\n                if k == 1:\n                    return val\n                else:\n                    k -= 1\n            \n        def inorder(self, root):\n            if root is not None:\n                for val in self.inorder(root.left):\n                    yield val\n                yield root.val\n                for val in self.inorder(root.right):\n                    yield val
['Python']