Write an algorithm to find an palindrome
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Can anybody help me by sharing some knowledge on software testing life cycle, how testing process done under UT,IT,ST,PT,UAT.?please explai me briefly regarding this. Best Regards, Keerthana.
what is regression testing & resting?
have you ever performed Back End Testing,HOW?
is Business requirment doc is configurations item or not how you control configurations control
How will u write test cases based on EQA(Equivalance class partitioning) & BVA(Boundary value analysis.?Plz explain in brief?
What are the categories of writing test cases?
why need testing ????
How to do manual testing of a E-insurance project (end to end process)
At what stage of the life cycle does testing begin?
What is the differnt between Test condition and TesT Scenario
What is the Database testing?? Is it necessary to have database knowledge for testing?had you ever tested the software by entering input at the front end and check it at back end?
What r the features,u take care in prototype testing?