习题3.17 懒惰删除

//Lazy delete
void
LazyDelete( List L )
{
    Position p;
    p = L;
    while( p->Next != NULL )
    {
        if( p->Next->judg == 1 )
            Delete( p );
        else
            p = p->Next;
    }
}

void
Delete( Position p )
{
    Position TmpCell;
    TmpCell = p->next;
    p->Next = TmpCell->Next;
    free(TmpCell);
}
View Code

 

posted @ 2015-07-12 12:22  Gabyler  阅读(162)  评论(0编辑  收藏  举报