[二叉树算法]删除叶子节点 (递归)
//删除叶子节点 void Delete_leaf(BTNode *t){ if(t==null) return; if(t->lchild!=null){ BTNode* tlchild=t->lchild; if(tlchild->lchild==null && t->trchild==null){ free(tlchild); t->lchild=null; } } if(t->rchild!=null){ BTNode *trchild=t->rchild; if(trchild->lchild==null && trchild->rchild==null){ free(trchild); t->rchild=null; } } Delete_leaf(t->lchild); Delete_leaf(t->rchild); }