I am having trouble mastering the concept of recursion...does anyone
here have any advice / excellent articles to share???


I don't understand how to create a recursion for this palindrome
method given this format
Palindrome(string str, int start, int end)

Not sure if the code below is the proper way. It does not work if
'end' is an odd number....


public static bool Palindrome(string str, int start, int end)
        {
            bool result = false;

            if (start == end)


                { return true; }


            else if (str[start] == str[end])

            { result = Palindrome(str, start + 1, end - 1); }



            else
                result = false;


            return result;


        }

Reply via email to