Ask your own question, for FREE!
Computer Science 96 Online
OpenStudy (anonymous):

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

OpenStudy (anonymous):

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)

OpenStudy (anonymous):

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.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Gucchi: english help!~
5 minutes ago 3 Replies 1 Medal
Nightmoon: Define Death
5 minutes ago 2 Replies 1 Medal
Gucchi: english HELP
20 minutes ago 9 Replies 1 Medal
Gucchi: enlgish hlep
37 minutes ago 6 Replies 1 Medal
Gucchi: engliSh help*
53 minutes ago 3 Replies 1 Medal
KoWoNo: Joseph's Birthday is coming up Dec. 18th!!
59 minutes ago 10 Replies 3 Medals
noobpro78: is junior year worse than shopmore?
1 hour ago 1 Reply 0 Medals
Gucchi: english help..
1 hour ago 146 Replies 4 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!