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

Answers were Sorted based on User's Feedback



Write an algorithm to find an palindrome..

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

Write an algorithm to find an palindrome..

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

Post New Answer

More Manual Testing Interview Questions

Can anyone tell me what is meant by "Mainframes Testing"? Also, Plz let me know what r all d responsibilities of a Manual Tester in Mainframes Testing? Plzzz reply!!

14 Answers   Accenture, American Express, Cap Gemini, Google, IBM,


What is the difference between Developer and programmer?

13 Answers   Tech Mahindra,


If you have 2 versions of a software (v1.0 & v1.1) and you are testing v1.0. How do you confirm that the defects found in v1.0 have been fixed and have not migrated to v1.1 ?

3 Answers   BN, Indi Shopee, Symphony,


Where we save the bugs?

2 Answers   Google,


What does entry and exit criteria mean in a project?

0 Answers  


What is the database testing?

5 Answers   Wipro,


How many testcases have you written till, now as an average per project?

1 Answers   AppLabs,


what is system testing? as test eng, what do u do in sys testing? who invoves in sys testing?

0 Answers   IBM,


What is difference between Quality Assurance and Quality Control?

3 Answers  


What is the V-model?

2 Answers  


Why should we hire you ? Please explain. Thanks

5 Answers  


What are testing techniques? What is difference between general and specific?

0 Answers   Wipro,


Categories