< previous page page_1077 next page >

Page 1077
        // Delete currPtr->link

        delPtr = currPtr->link;
        currPtr->link = currPtr->link->link;
    }
    delete delPtr;
}
Let's delete the node whose component is 90. The structure is shown below, with the nodes labeled as they are when the While statement is reached.
1077-01.gif
while (currPtr->link->component != item)


currPtr = currPtr->link;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Because 50 is not equal to 90, the loop body is entered.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Pointer is advanced.
1077-02.gif

 
< previous page page_1077 next page >