CS212 Problem Sets
FAQ - Problem Set
4

LAST UPDATE: Wednesday, January 19, 2000 11:35 PM

Since there was a request from students in the course that official answers to questions be put on the web page, we're writing this FAQ. When questions on the newsgroup are posted, and we feel that it's something that everyone should know about, we'll post the official response here.


The member function provided by Scheme returns a list instead of #t, if it finds the value in the list. How do I get it to return #t instead of a list?

Remember that anything that is not #f, is true. So if you use (member v l) as a condition, it's okay for it to return a list.

For display-labeled-edge, is it okay for it to return something like ((from-vertex to-vertex label) ...), or must it return ((form-vertex label to-vertex) ...)?

It is okay to return either. It really doesn't matter to us, just make the output readable. If you're thinking about using display-labeled-edge in another function, use it only if you have to.

Is it okay to use equals? in this problem set?

Yes. You may use equals? to compare two objects for congruency. Just be careful not to do more work than you need to. In other words, don't create objects just to use the equals? function if you can do it another way.