Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 485 Bytes

File metadata and controls

22 lines (18 loc) · 485 Bytes

 Node* reverseDLL(Node * head)
    {
        Node* cur=head;
        Node* temp=NULL;
        
        while(cur!=NULL)
        {
            temp=cur->prev;
            cur->prev=cur->next;
            cur->next=temp;
            cur=cur->prev;
        }
        
        if(temp!=NULL)
            head=temp->prev;
        
        return head;
    }