Write an algorithm to find an palindrome
Answer Posted / 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 |
Post New Answer View All Answers
what is your daily activities?
what are risks and contigencies(solutions) of an ecommerce (online shopping and bidding project)application?we describe this in Test plan can anyone tell me abt this?
How should your staff be managed? How about your overtime?
What is sanity?
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
What is an error?
Can you please provide me the standard testcase review templete and Test plan templete.In my company we are not following any Standards templete so.Please guve me some Excell attachments.
You may be overqualified for this position we have to offer
Need to know about Quality Center in brief
Do we have any certifications for ETL Testing ?
What is the procedure of manual testing?
what is the difference between test case and result matrix
which sanity testing is performed?
what is functional testing terminologies
Work flow in testing in your company?