Write an algorithm to find an palindrome
Answers were Sorted based on User's Feedback
Answer / sagai
boolean isPalindrome(string s){
char[] letters = s.toCharArray() //convert string to
array of characters
int firstCnt = 0 //counter for left side
int secCnt = letters.length - 1 //counter for right
side
while (firstCnt < secCnt){ //work toward middle
if (letters[firstCnt] != letters[secCnt]){
return false //if left and right does not
match, is not a palindrome
}
firstCnt++
secCnt--
}
return true //if loop completes without a false, is a
palinrome
}
| Is This Answer Correct ? | 20 Yes | 9 No |
Answer / nandan_101
boolean isPalindrome(string s){
char[] letters = s.toCharArray() //convert string to
array of characters
int firstCnt = 0 //counter for left side
int secCnt = letters.length - 1 //counter for right
side
while (firstCnt < secCnt){ //work toward middle
if (letters[firstCnt] != letters[secCnt]){
return false //if left and right does not
match, is not a palindrome
}
}
return true //if loop completes without a false, is a
palinrome
}boolean isPalindrome(string s){
char[] letters = s.toCharArray() //convert string
<strong class="highlight">to</strong> array of characters
int firstCnt = 0 //counter for left side
int secCnt = letters.length - 1 //counter for right
side
while (firstCnt < secCnt){ //work toward middle
if (letters[firstCnt] != letters[secCnt]){
return false //if left and right does not
match, is not a <strong
class="highlight">palindrome</strong>
}
}
return true //if loop completes without a false, is a
palinrome
}
| Is This Answer Correct ? | 5 Yes | 18 No |
Can anyone tell me what is meant by "Mainframes Testing"? Also, Plz let me know what r all d responsibilities of a Manual Tester in Mainframes Testing? Plzzz reply!!
14 Answers Accenture, American Express, Cap Gemini, Google, IBM,
What is the difference between Developer and programmer?
If you have 2 versions of a software (v1.0 & v1.1) and you are testing v1.0. How do you confirm that the defects found in v1.0 have been fixed and have not migrated to v1.1 ?
3 Answers BN, Indi Shopee, Symphony,
Where we save the bugs?
What does entry and exit criteria mean in a project?
What is the database testing?
How many testcases have you written till, now as an average per project?
what is system testing? as test eng, what do u do in sys testing? who invoves in sys testing?
What is difference between Quality Assurance and Quality Control?
What is the V-model?
Why should we hire you ? Please explain. Thanks
What are testing techniques? What is difference between general and specific?