Esempio n. 1
0
void SgNode::DeleteBranches()
{
    SgNode* main = LeftMostSon();
    while (main)
    {
        SgNode* brother = main->RightBrother();
        while (brother)
        {
            SgNode* nextToDelete = brother->RightBrother();
            brother->DeleteSubtree();
            delete brother;
            brother = nextToDelete;
        }
        main = main->LeftMostSon();
    }
}
Esempio n. 2
0
void SgNode::DeleteTree()
{
    SgNode* root = Root();
    root->DeleteSubtree();
    delete root;
}