#include#includeusing namespace std;typedef struct TreeNode{ char c; int w; int parent; int right; int left; int tag; char * code;}Node;void Find(Node * tree, int n, int & m1, int & m2){ m1 = -1; while(tree[++ m1].tag != 0); m2 = m1; while(tree[++ m2].tag