Algorithm to Delete a Node in Singly Linked List

Algorithm fnSLL_Delete(ptrNodeP, ptrNodeQ)
{
ptrNodeP->ptrNext=ptrNodeQ->ptrNext;
ptrNodeQ->ptrNext=Null
Data=ptrNodeQ->Data;
free(ptrNodeQ);
return(Data);
} //End of Algorithm