Write an algorithm to find an palindrome
Answer Posted / 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 |
Post New Answer View All Answers
What is the full form of cmmi?
tell me some major and minor defects in ur net banking project?
As you are working with cmmi level 5 company ,can you tell me what processes you r following as QA engineer?
Suggest some book to learn more test case???
What’s the difference between verification and validation in testing?
What is a test severity and test priority? difference between them with suitable examples?
Please send any one latest 3+ years of experience testing tools resumes my mail id is krishnavenimodaliar26@gmail.com
Where we have to use perl scripting in Testing approach and its importance
I have interview on Guide wire testing. If you please share me.
What r the functional testing u perform?
Negative test cases for phone camera
What is difference in between operating system 2000 and os xp?
My name is Akpos from Nigeria. I have finished manual testing course. Please, can someone advise me where to go on from here?
What is difference between V-Model and Agile Model?
Please anyone give answers for all below questions and help ? realtimers please and please share your knowledge.lot of questions left unanswered.