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 mutation testing & when can it be done?
Why would we not include these?
What are the queries mostly asked in testing ? give me some examples.
According to RBI rule how much money can be transferred through online banking at one time...?
Unix question: 1)command to print a list of files containing a particular word. 2) what does a .profile mean. 3) what is a file server? 4) Command to move towards left in vi editor explain grep and find commands using example.
Hello again!! wanted to ask you HOW EXACTLY create stubs and driver in integration testing? 2.whats the difference between integration testing and system integration testing? Thanks!!
I am new to testing, I need information about TSYS any website or if you have information please mail it to me. this is for online credit applications project.My mail id is keerthanakoluvu@yahoo.com. Thanks for your help.
what are your thoughts on SPRINT duration
How a test engineer will convince a test lead when he didn't approve the bug as a report ???
what types of testing you performed in transfer funds module....
tell me 5 new requirements in ur project? plz urgent
Hi, can any tell how a tester can be judged? i have to interview a tester, how should i judge whether he has a justified experience or not? how a person with 3 years of experience in manual testing can be judge?
consider therez 1 land and it has mango trees in it, what are the tets cases or how will we count no of mangoes on all trees
what is the difference between Risk based and Requirement based testing???
A defect which could have been removed during the initial stage is removed in a later stage. How does this affect cost?