Skip to contentSkip to conversation

Sorted List

DISCUSSION Bharat Jain 1 participant 1 message Nov 26, 2005

lore
Share & tools
lore
#0 lore raw

After the while loop "sp" would be containing the address of the node after which the new node is to be inserted.

It is done in this way because *sp = *sp->next would modify the global "empty" pointer which we dont want. "empty" should always point to first element of the list.

Hope this helps.