< previous page page_1071 next page >

Page 1071
Insert(60)
newNodePtr = new NodeType;
newNodePtr->component = item;
prevPtr = NULL;
currPtr = head;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
These four statements initialize the variables used in the searching process. The variables and their contents are shown below.
1071-01.gif
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
while (currPtr != NULL &&
item > currPtr->component)




prevPtr = currPtr;
currPtr = currPtr->link;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Because 60 is greater than 30, this expression is TRUE and the loop body is entered.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Pointer variables are advanced.
1071-02.gif

 
< previous page page_1071 next page >