Write an algorithm to find an palindrome
Answer Posted / 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 |
Post New Answer View All Answers
what is test case management?explain in brief.
hi, this is geetha, i have one doubt regarding the vulnerability testing. For sql injection testing is there any need for the tools to be installed. If it is what is tool and what is the method to test in sql injection testing. Plz Guide me
name poneno dept sun 9894433467 computer This is the xls sheet a programs written to transfer this data into database write test cases and test scenario?
What is a defect?
a newly launched web site is hosted on web server.It is expected that 100 people visit the website every hour and browse 30 pages spending a total 15 minutes. what is the maximum hits/sec that the web server should support this load?justify your answer. need urgently. by rimesh
if yahoo ceo asks you to do performance testing for yahoo site, what are the inputs you ask from them?
wat are the questions would the project leader ask about the project?? please do send the answers early.
Presently working in software company as a software test engineer with 1.5 yrs of experience but i am 2002 passout.Gap is 6 yrs.Is there any problem getting job in MNC? Which criteria HR follows for recruiting test engineer?
What are the bugs we cannot find in black box?
What is showstopper defect?
What about manual testing opening in bangalore in September. Not getting a single interview call from last one month.
Write all combinations of test cases for calculater on + symbel
How will you prepare traceability matrix if there is no Business Doc and Functional Doc?
what is the difference between test case and result matrix
what is the most critical bug u have to find in ur project.My application is ERP based,in this purchase module is there.plz tell me the answer?