public static boolean isListAPalindrome(sNode head){
        //If were using doubly linked lists we would first figure out the length then accordingly from the middle
        //expand to both ends and compare values. This will be done O(n)

        //However given that this we only have a singly linked list, we would find the middle, reverse the second half
        //and then compare linearly. Again this is O(n) time.
        int length = 0;
        sNode curr = head;
        while(curr != null){
            length++;
            curr = curr.next;
        }
        
        //travel to the middle node
        curr = head;
        for(int i = 1; i<=length/2; i++){
            curr = curr.next;
        }

        sNode sHalf = null;
        if(length % 2 == 0)
            sHalf = reverseList(curr);
        else
            sHalf = reverseList(curr.next);
        
        //next we compare the halves
        for(int i =0; i<length/2; i++){
            if(head == null) break;
            if(head.data != sHalf.data) return false;
            head = head.next;
            sHalf = sHalf.next;
        }
        return true;
    }