Snippets Collections
        if(!head || head->next  == NULL)
            return head;
        Node* fast = head->next->next,*slow = head;
        while(fast->next && fast->next->next){
            fast = fast->next->next;
            slow = slow->next;
        }
        if(fast != NULL)
            slow = slow->next;
        Node* head2 = reverse(slow->next);
        slow->next =  NULL;
star

Sat May 27 2023 13:12:19 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/modify-linked-list-1-0546/1

#c++ #halve_the_ll

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension