O(k) space, O(n) time, 10+ short lines, 3 solutions
The solutions I've seen so far use O(n) space, either for the recursion stack or for the self-managed stack. Here's an iterative inorder traversal version that 
The solutions I've seen so far use O(n) space, either for the recursion stack or for the self-managed stack. Here's an iterative inorder traversal version that only uses O(k) space by using a "stack" cut off at k elements. I called it `stac` because of that and had to laugh when I then wrote `stac(k)` :-)\n\n---\n\n**Solution 1, Python with deque(maxlen=k)**\n\nUsing a deque, setting its maximum length to k.\n\n    def kthSmallest(self, root, k):\n        stac = collections.deque(maxlen=k)\n        while True:\n            while root:\n                stac.append(root)\n                root = root.left\n            root = stac.pop()\n            if k == 1:\n                return root.val\n            k -= 1\n            root = root.right\n\n---\n\n**Solution 2, C++ with circular vector**\n\nUsing a vector of fixed size k and a stack pointer `i` into it which will be used modulo k.\n\n    int kthSmallest(TreeNode* root, int k) {\n        vector<TreeNode*> stac(k);\n        int i = 0, j = k;\n        while (true) {\n            while (root) {\n                stac[i++%k] = root;\n                root = root->left;\n            }\n            root = stac[--i%k];\n            if (! --j)\n                return root->val;\n            root = root->right;\n        }\n    }\n\n---\n\n**Solution 3, C++ with deque**\n\nI really like the previous version, but the fixed size `k` isn't always necessary, so here's a version using a deque:\n\n    int kthSmallest(TreeNode* root, int k) {\n        deque<TreeNode*> stac;\n        while (true) {\n            while (root) {\n                stac.push_front(root);\n                while (stac.size() > k)\n                    stac.pop_back();\n                root = root->left;\n            }\n            root = stac.front();\n            stac.pop_front();\n            if (! --k)\n                return root->val;\n            root = root->right;\n        }\n    }\n\n---\n\nAnd now I'm waiting for the Morris traversalists to show up...
['Python', 'C++']