Write an algorithm to find an palindrome
Answer Posted / 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 |
Post New Answer View All Answers
Hi friends, Im an MBA Finance, 2 yrs of exp workng in Investment com, + around 2 yrs of exp in Manual testing in Finane domain. Im looking for manual testing jobs but not getting any calls, Im worried is manual tesing in finance domain do have any good scopes in future or not. Plz provide me ur valuable suggestion,so tht I can best decision to retain in this platform(manual testing). or not
Diffrence b/w functional testing,functionality testing,system testing?
10 scenarios for security testing using gmail applications?
Please anyone give answers for all below questions and help ? realtimers please and please share your knowledge.lot of questions left unanswered.
Why do you need to parameterize fields in your virtual user script?
Relative to other technical groups in the company? Relative to your staff?
How do you know the code has met specifications?
What is six sigma?
1. Give me an example of something you tried at work but did not work out so you had to go at things another way. can somebody give a real time example
What and why is api testing?
What is the full form of cmmi?
What is the Difference between Network testing and Web Testing?
How do u go about testing of web application?
can any one post the format of tracebility martrix Plz...... Maid Id: sandhya.shyamala@yahoo.com
Beyond the customary advantages of having a testing group, what are the benefits does a company receive from a well run, automated testing group?