I'll be happy to help. I assume you are dealing with an exercise. Is this a self-study or do you have a teacher? If you have a teacher he or she is the best person to help you. Can you show me what you have so far? (if you like off list) Without some more input from your part, it is difficult to provide clues how to proceed without revealing too much. Which language are you using? May be one of the student languages of Racket? Best wishes, Jos
_____ From: users-boun...@racket-lang.org [mailto:users-boun...@racket-lang.org] On Behalf Of Andrew Regnery Sent: jueves, 21 de marzo de 2013 20:51 To: users@racket-lang.org Subject: [racket] Graphing Help Hi All, I am currently struggling with this function below. Can anyone help me out? Write the following two functions. ; a graph is ; (make-graph (listof symbol) (symbol -> (listof symbol))) (define-struct <http://docs.plt-scheme.org/htdp-langs/intermediate-lambda-unchanged.html#(f orm._((lib._lang%2Fhtdp-intermediate-lambda..rkt)._define-struct))> graph (nodes neighbor)) ; has-self-loop? : graph -> boolean ; Determines whether any node in the given graph is its own neighbor ; has-cycle? : graph -> boolean ; Determines whether the given graph has a cycle. A cycle is a path from a node to itself, and a self-loop is a special case of a cycle that consists of only a single edge.
____________________ Racket Users list: http://lists.racket-lang.org/users