Double linked list deletion at beginning is not working

Deletion at beginning of double linked list not working

after deleting element you have to update head as well
in the main

correct one is

Node* deleteAtBeg(Node* head)
{
    if(head==NULL)
    {
        cout<<"Not Possible of deletion empty list!!" ;

    }
    else
    {
        Node* temp=head;
        if(temp->prev==temp->next)//Incase of one new node
        {
            head=NULL;
            delete temp;
        }
        else
        {
            head=temp->next;
            head->prev=NULL;
            delete temp;

        }
    }

return head;
}

and in main()

head =deleteAtBeg(head);

these changes will work

if your doubt is resolved
Please mark it as resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.