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 |
what is difference between black box and white box testing? In most of the companies which tecnique is used
What are the contents in "Requirements Traceability Matrix" not in " Test Responsibility Matrix"?
How will you select the regression test case?
Nowadays Product based testing is done is almost all companies. What does a "Product" actually means.
Hi , Please send me the interview questions which were asked in manual testing mainly the test cases asked to write in interview.
Do you write test cases for regression testing?
if we ve 1000 test cases to run and we ve no time and we dnt wanna use automation tool how we will complete testing in time constrant plz do answer
Test cases for Equity,Bond,Futures and options financial instruments
What is Back End testing?
How should I manage the test cases? Should I have to write Version/Build number in the test cases against test cases which is get modified for that build/version.
what is the difference b/w Priorty and severity in Bug Report
What is mutation testing?? And when we use it??