C++ o(1) space easy to understand


#1
` int smallest; 
void inorder(TreeNode* root,int& k){ //inorder
   if (!root) return;
   inorder(root->left, k);
   if (!k) return;
   --k; 
   smallest = root->val;
   inorder(root->right,k);
}
 int Solution::kthsmallest(TreeNode* A, int B) {
 inorder(A,B);
 return smallest;
}

`