Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is mutation testing & when can it be done?

1104


Why would we not include these?

1089


What are the queries mostly asked in testing ? give me some examples.

1859


According to RBI rule how much money can be transferred through online banking at one time...?

2845


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.

2436


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!!

2121


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.

2058


what are your thoughts on SPRINT duration

2053


How a test engineer will convince a test lead when he didn't approve the bug as a report ???

1592


what types of testing you performed in transfer funds module....

1638


tell me 5 new requirements in ur project? plz urgent

2350


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?

1993


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

1987


what is the difference between Risk based and Requirement based testing???

2200


A defect which could have been removed during the initial stage is removed in a later stage. How does this affect cost?

1424