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 Test methodology, Testing type , Testing approach, Testing technique & Testing methods. Explain with example.
What is difference between Bug resolution meeting & Bug Review Committee? Who are participants?
What is the difference between a defect and a failure?
What is bug, deffect, issue, error?
can someone give me a brief idea about embedded testing.. i know both embedded system concepts and testing concepts.. i just want to know what we have to do for embedded testing
what will be verification and validation test cases for yahoo login page (only functional test cases)? Please explain in details.
How soon the bug should get fixed?
How can we test for drastic (severe) memory leakages?
What is mean by Schedule report who is the responsible for generated that one ?
What is localization testing (l10n testing)?
hi friends i recently finished testing course in hyderabad.now am looking for a job in uk.i need help about the projects in interview point.can any one explain me abt banking project or credit card.like what are the problems faced in u r last project etc.
In usability testing we check spelling, content, look and feel, color combination, link or menu navigation? please let me know more about usability testing.
i) functional test cases can we consider for regression test ? or we have to write separet test cases for regression test ? ii) How to write the system test case and what are the technique shall we have to follow ?
IF ASCII_CODE_OF_ENTERED_CHAR is less than 44 THEN reject it ELSE IF ASCII_CODE_OF_ENTERED_CHAR is greater than 56 THEN reject it ELSE it's a digit, so accept it Which one of the following sets of ASCII codes do you use to test the sample code above WITHOUT redundant coverage?
how to write defects in excel sheets when defects occured