Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Piinky Group Title

help on attachment

  • 3 years ago
  • 3 years ago

  • This Question is Closed
  1. Piinky Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    • 3 years ago
    1 Attachment
  2. Piinky Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    question 2 (a)

    • 3 years ago
  3. Narsat Group Title
    Best Response
    You've already chosen the best response.
    Medals 4

    I would go for the easy way; trim all spaces on the string, and compare first place of the string to the last, make sure they're equal. then second to last-1, third to last-2, ... until you get to length/2. Return true if you get to length/2. false if at any point they are different. Example: able was i ere i saw elba -trim- ablewasiereisawelba compare: a = a? yes compare b = b? yes compare l = l? yes etc.

    • 3 years ago
  4. Narsat Group Title
    Best Response
    You've already chosen the best response.
    Medals 4

    Apparently, I can't read, it's recursive. but same thing applies. public boolean testPalindrome(String palindrome){ if(palindrome.length() <= 1) return true; if(palindrome.chatAt(0) == palindrome.charAt(palindrome.length()-1) return testPalindrome(palindrome.substring(1, palindrome.length-1); else return false; } Code in Java, but it should be easy to adapt. You should do the comparison, and send to the recursive function the String minus the first and last places, then go at it again. Test for length, return true if you've reached 1 or 0 (if length was odd or even numbered), and return false if at any point they differ.

    • 3 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.