#include #include #define null -1 typedef int PNODE1; /* a node */ char value[100]; /* value */ int lch[100]; /* left child links */ int rch[100]; /* right child links */ int mem = null; /* fake top of memory */ /* function Insert1 ------------------------------------------- */ PNODE1 Insert1(PNODE1 n,char c) { if (n == null) { n = ++mem; value[n] = c; lch[n] = rch[n] = null; return n; } if (c < value[n]) lch[n] = Insert1(lch[n],c); else rch[n] = Insert1(rch[n],c); return n; }/*end Insert1*/ /* function Show1 --------------------------------------------- */ void Show1(PNODE1 n) { if (n == null) return; Show1(lch[n]); printf(" %c",value[n]); Show1(rch[n]); }/*end Show1*/