I am trying...
while(current->next!=NULL && current->value<deleteValue)
{
previous=current;
current=current->next;
}
if(current->value==deleteValue)
{
if(previous==NULL) //If the deleteValue is the first node
head=current->next; //Change the head
else
{
previous->next=current->next;
}
if(current->next!=NULL) //If the node to be deleted is not the last node
current->next->prev=previous;
}
However I couldn't find enough blank to free the node.