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

veryconfused Group Title

All trailing zeros in a list-of-digits can be removed without changing the number it represents. Write a function lod-clean that removes trailing zeros from a list-of-digits. this is to be done using scheme @Computer Science

  • 3 years ago
  • 3 years ago

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

    such that (lod-clean (list 1 2 3 4 0 0 0)) => (list 1 2 3 4) (lod-clean (list 0 0 0))=> empty (lod-clean (list 5 5 0 5)) => (list 5 5 0 5)

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

    How to really use scheme escapes me at the moment, I'm out of practice with it, but if I remember correctly, the solution to this problem should be something as follows: 1. Recursively go to the end of the list. (until cddr is null or empty) 2. Check if cadr is a zero. 3. If cadr is different from zero, put it together with the rest of the list using (cons ..) or another way of putting lists together. Throw it away otherwise. 4. Return fully assembled list. I'll try to come up with the actual function, but don't trust me on it, since I don't have Scheme on this machine, and it's been long since I last used it. Good luck.

    • 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...


  • 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.