Polynomial Addition using Linked List

Algorithm fnPolyAdd(ptrPolyA, ptrPolyB, ptrPolyC)
{
 PolyNode *ptrTempA, ptrTempB;
 ptrTempA=ptrPolyA;
 ptrTempB=ptrPolyB;
while(ptrTempA!=NULL && ptrTempB!=NULL)
{
 if(ptrTempA->iExp==ptrTempB->iExp)
{
 ix=ptrTempA->iCoeff+ptrTempB->iCoeff;
 if(ix!=0)
 insert ix and ptrTempA->iExp into C;
 ptrTempA=ptrTempA->ptrNext;
 ptrTempB=ptrTempB->ptrNext;
}
elseif(ptrTempA->iExp<ptrTempB->iExp)
{
 insert ptrTempB->iCoeff and ptrTempB->iExp into C;
 ptrTempB=ptrTempB->ptrNext;
 }
else
{
 insert ptrTempA->iCoeff and ptrTempA->iExp into C;
 ptrTempA=ptrTempA->ptrNext;
}
}
while(ptrTempA!=NULL)
{
 insert ptrTempA->iCoeff and ptrTempA->iExp into C;
 ptrTempA=ptrTempA->ptrNext;
}
while(ptrTempB!=NULL)
{
 insert ptrTempB->iCoeff and ptrTempB->iExp into C;
 ptrTempB=ptrTempB->ptrNext;
}
return ptrPolyC;
}  // End of Algorithm