 |
|
|
|
|
while (currPtr != NULL &&
item > currPtr->component)
newNodePtr->link = currPtr;
if (prevPtr == NULL)
head = newNodePtr; |
|
|
|
|  |
|
|
|
|
Because 20 is less than 30, the expression is FALSE and the loop body is not entered. |
|
|
|
 |
|
|
|
|
link member of *newNodePtr now points to *currPtr. |
|
|
|
 |
|
|
|
|
Because prevPtr is NULL, the then-clause is executed and 20 is inserted at the top of the list. |
|
|
|
|