Algorithm to Delete a Node in Doubly Linked List

Algorithm fnDLL_Delete(ptrNodeB)
{
Data=ptrNodeB->Data;
ptrNodeB->ptrRight->ptrLeft=ptrNodeB->ptrLeft;
ptrNodeB->ptrLeft->ptrRight=ptrNodeB->ptrRight;
ptrNodeB->ptrLeft->ptrNodeB=ptrRight=NULL;
free(ptrNodeB);
return(Data);
} // End of Algorithm