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 |
When they freez(baseline) the requirement means in which phase of sdlc
what is migration testing?
what is application state, base state, & call state.
How do u ensure that there are no duplicate testcases?
how to Link the requirement with Test Cases in the Treaceability Matrix. Give real time Example ( Pl. Real Time Project testers only)
eqivalance testing class is made from data and this is made to minimize the test cases and it is black box testing what at which particular time we do this testing i guess while creating test cases we consider this testing .plz if lett me know if i am wrong
how to track defects by using JIRA bug tracking tool
write the negative test cases for pencil based on it's functionality
what is meant by CLOUD?
when doing regression testing, how can we know that other screen or module are affected?
How can u know IP Address of a computer?
what is WinRunner frame