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
How the application is launched to the production environment?
Hi I want to start online training couses for testing Any body plz help me out how to start the online courses Plz post the answer here or send me a mail for kommineni.1020@gmail.com
What's the difference between alpha and beta testing?
How we allocate the priority(Blocker, Critical, etc.,) in Testing?
What is a testbed in manual testing?
what is the difference between Desktop testing,Client/server testing and webapplication testing
What is exploratory testing and when should it be performed?
can we do database testing in manual testing? then how we write the test case?
What is smoke testing and user interface testing ?
test measurment techniques
How to do the performance testing manually? Does you have a test case for that?
Suggest some book to learn more test case???
What are the various techniques in black box testing?
tell wat u did in ur banking project?
whta is compile module?