#include<iostream> #include<string> using namespace std; struct tree { char c; tree* lc; tree* rc; tree(char ch) { c = ch; lc = NULL; rc = NULL; } }; string s; int n, i;//n是s的长度,i是指向字符串的当前位置 tree* buildTree() { tree* root = new tree(s[i]); //类似于先序遍历,所以处理放在递归前 if (i + 1 >= n)//可以理解成就是保...