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 quality process is following in your organization.
Could someone please send me real check list for Database Security testing.Please my mail ID- patil.ramchandra@yahoo.co.in. Thanks.
please send me database stored procedure checklist.
what is dib format?
14.What is function point breakdown?
What is Independant Testing? When and where this type of testing will be performed?
how recovery manager works in winrunner
what is coupling integration testing
if go through 1 or 2 projects clearly,then i feel comfortable to search the job,please help me
Hi All I want discuss abt Testing tools is any one available online in google chat?
Explain thread testing.
What is a top-down and bottom-up approach in testing?
What are the review documents used for testing?
tell me 5 new requirements in ur project? plz urgent
In manual testing, what are stubs and drivers?