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
If we have no srs, brs but we have test cases does you execute the test cases blindly or do you follow any other process?
Hi Friends, I have completed 3 rounds of an Interview with HR discussion also and got Offer letter from Cognizant, but after in 30 min they send one more email like Offer is on Hold, and its not valid... Could you please guide me any one , Can i expect Offer again from Cognizant or Can i drop the hopes ?.
Write a set of test cases to test youtube?
What is an audit report? Whom is it done by?
few automation basic questions One question to write a scriot in any language you know.
What are the typical risks that you identify during test planning and their mitigation plan and Contengency plan.
What is Test Design ?( Urgent) and Test Design for Printer?
How should your staff be managed? How about your overtime?
write test condition for testing SMS service of a mobile phone maximun length is 100 character while sending and 80 character for receiving write test scenarios do not write test cases
What is alpha testing?
how will we change the server system time?
What is the purpose of test strategy?
What are the principles of software testing?
What are the different servers and difference between them?
Describe any bug you remember. Plz Give some real examples