Example #1
0
int main(int argc, char* argv[]){
    SLList* pSLList = new SLList();
    pSLList->addToHead("tom", 1);
    pSLList->addToTail("jerry", 2);
    pSLList->addToTail("thomas", 3);
    int* pa = pSLList->deleteFromHead();
    printf("the deleted head value should be tom's,  %d\n", *pa);
    pa = pSLList->deleteFromTail();
    printf("the deleted tail value should be thomas',  %d\n", *pa);
    pSLList->deleteNode("jerry", 2);
    if(pSLList->isEmpty()){
        printf("yes, it is empty now\n");
    }
    delete pSLList;
    pSLList=0;
    return 0;
}