Jet Interview Question

Write an algorithm to determine if a string is a palindrome.

Interview Answers

Anonymous

Aug 6, 2015

With a good algorithm.

Anonymous

Feb 19, 2016

string pal = "abcba"; bool isPalindrome = true; int length = pal.Length; for (int i = 0; i < (int)length / 2; i++) { if (pal[i] != pal[length - i - 1]) { isPalindrome = false; break; } }