1、本题多了每个节点的长度 cnt, 叶子节点的 cnt == 1
非叶子节点的 cnt == 左孩子的cnt + 右孩子的cnt (这里,非叶子节点至少一个孩子)
2、然后由 先序 + 后续 确定一颗二叉树的时候,顺便处理 每个节点 的cnt
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MaxN = 10010;
char s1[MaxN], s2[MaxN];
typedef struct Node
{
int cnt;
char data;
Node* lchild;
Node* rchild;
}node, *pNode;
pNode build_bintree(int l1,