Pregunta de entrevista de Jet

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

Respuestas de entrevistas

Anónimo

6 ago 2015

With a good algorithm.

Anónimo

19 feb 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; } }