Function to check Linked Lists is Even or odd

PHOTO EMBED

Fri Oct 06 2023 12:11:23 GMT+0000 (Coordinated Universal Time)

Saved by @DxBros #linkedlists #evenlength #o(n) #c++

bool isEven(Node* head){
            Node* fast = head;
            while(fast && fast->next) fast=fast->next->next;
            if(!fast )
                return true;
            return false;
    }
content_copyCOPY

https://practice.geeksforgeeks.org/problems/given-a-linked-list-reverse-alternate-nodes-and-append-at-the-end/1