Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

If we are enterinf different inputs for the same field then tester have to write that much separate test cases with separate ID. E.g. First name field Inputs are - 1. valid name = Shyam, 2. Digits , 3. Blank Space, 4. Empty Name, 5. Enter name after blank space, 6. Special Characters etc. So May I have to write 6 separate test cases with test case id 1,2,3,4,5 & 6.?

4 Answers  


. Diff. between Application server and web server? 2. Default port number of Tomcat? 3. bug life cycle? 4. what is defered status in defect life cycle? 5. smoke test? 6. Do you use any automation tool for smoke testing?? 7. verification and validation? 8. Testing process in your comp.? 9. Testing methodology? 10.when a bug is found what is the 1st action? 11.what is best bug in your current proj. which you found?? 12.what is test plan and explain its contents? 13.Advantages of automation over mannual testing? 14.explain some SDLC models? 15.ADhoc testing? 16.what is mean by release notes? 17.what are all the contents of release checklist? 18.when a new build comes what is 1st action?(performing smoke test). 19.how many test cases will you write for 1 day? 20.what is the bugbase do you use in your comp.?

3 Answers   BeBo Technologies,


HI GUYS...I INFORM U ONE IMP MATTER PLS..... REMEMBER IT...IN AMEERPET OR HYD ..YOU NEVER GO TO TRAINING FOR ETL TESTING..BECAUSE ALL FACULTIES ARE FRAUDS.. ZERO KNOWLEDGE ON ETL TESTING...ESPESIALLY "INFOSHARE TECH", & "CTRL+A" ETC...

1 Answers  


What r blackbox & whitebox testing techniques?

3 Answers  


What are the different options which will be entered while creating the test case?

2 Answers   IBM,






10. How long have you been involved in Web accessibility?

0 Answers  


Whatz the main use of preparing a tracebility matrix

3 Answers  


What is TRR ?

3 Answers   Covansys,


What is an IDE?

3 Answers  


What is Defect Leakage?What Gap Analysis? What are the functioanl requirements to test the Software? What is Latency bug?

1 Answers   Crea, Yardi,


What are the key challenges of testing?

2 Answers  


What are the different techniques for writing test cases?

10 Answers   Cap Gemini,






Categories