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 u give me the sample bug report
what are the different statuses of test cases?
is software testing easy ??? Give me perfect Ans.
at the time of testing web based applications and client server apllications, what you absorved as a tester? (i need not differences, but i need what you absorved at the time of testing as a tester)
hi all friends, i want to know about certification of testing.this is online exam.tell me the fee of this exam also. any boday tell me the institute who conduct this in delhi ncr.& who give some saurity also. praveen test engineer
what qualities a person must have to become a good tester
What is meant by YUI testing?
what are all requirements need for create gmail login page
What is Sanity Testing?
What makes a good test engineer?
what are iso,cmm,cmmi,level1,level2 etc in testing?
tell me 5 new requirements in ur project? plz urgent