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 |
Explain test procedure and write test cases for EFTPOS/CREDIT CARD
What is the Jar file?
What is Defect Seeding?
why you want 2 join Testing ?
I Have a login screen.Jus before the release you see the screen and there is a bug.Tell mde wats the bug. screen : Logen : Password : | Submit |(submit is a button)
Define brain stromming and cause effect graphing?
What is the diff. between Sanity , smoke and ad-hoc testing?
Can any body tell me in real time how cookies testing is done. And please tell me the steps.And for cookies testing test cases is needed.
hai friends can u expalin about real time process of testing at the company, like flow diagram
How do we do Database testing?. How does our knowledge on SQL is useful in Database testing?. Please explain the process if possible.
what is the difference between test strategy and test methodology?
A defect which could have been removed during the initial stage is removed in a later stage. How does this affect cost?