/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ /** * * @param pRootOfTree TreeNode类 * @return TreeNode类 */ void in_order(struct TreeNode *root, struct TreeNode** new_list) { if(!root) return; else { in_order(root->left, new_list); root->left = *new_list; if(*new_list) { (*new_list)->right = root; } (*new_list) = root; in_order(root->right, new_list); } } struct TreeNode* Convert(struct TreeNode* pRootOfTree ) { // write code here struct TreeNode *new_list = NULL; in_order(pRootOfTree, &new_list); while(new_list && new_list->left) { new_list = new_list->left; } return new_list; }