<p style="margin:1em 0px;font-family:serif;font-size:medium;background-color:rgb(255,255,255)">Hi All,</p><p style="margin:1em 0px;font-family:serif;font-size:medium;background-color:rgb(255,255,255)">I am currently struggling with this function below. Can anyone help me out? </p>
<p style="margin:1em 0px;font-family:serif;font-size:medium;background-color:rgb(255,255,255)"><br></p><p style="margin:1em 0px;font-family:serif;font-size:medium;background-color:rgb(255,255,255)">Write the following two functions.</p>
<p style="margin:1em 0px;font-family:serif;font-size:medium;background-color:rgb(255,255,255)"><table cellspacing="0" class="RktBlk"><tbody><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="hspace" style="font-family:monospace"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">;</span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">a graph is</span></td>
</tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">;</span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">(make-graph (listof symbol) (symbol -> (listof symbol)))</span></td>
</tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span><span class="RktPn" style="font-family:monospace;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;color:rgb(38,38,128)"><a href="http://docs.plt-scheme.org/htdp-langs/intermediate-lambda-unchanged.html#(form._((lib._lang%2Fhtdp-intermediate-lambda..rkt)._define-struct))" class="RktStxLink" style="text-decoration:none;color:black;font-weight:bold">define-struct</a></span><span class="hspace" style="font-family:monospace"> </span><span class="RktSym" style="font-family:monospace;color:rgb(38,38,128)">graph</span><span class="hspace" style="font-family:monospace"> </span><span class="RktPn" style="font-family:monospace;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;color:rgb(38,38,128)">nodes</span><span class="hspace" style="font-family:monospace"> </span><span class="RktSym" style="font-family:monospace;color:rgb(38,38,128)">neighbor</span><span class="RktPn" style="font-family:monospace;color:rgb(132,60,36)">)</span><span class="RktPn" style="font-family:monospace;color:rgb(132,60,36)">)</span></td>
</tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span></td></tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline">
<span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">;</span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">has-self-loop? : graph -> boolean</span></td>
</tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">;</span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">Determines whether any node in the given graph is its own neighbor</span></td>
</tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span></td></tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline">
<span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">;</span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">has-cycle? : graph -> boolean</span></td>
</tr><tr><td style="padding-left:0px;padding-right:0px;vertical-align:baseline"><span class="RktPlain"><span class="hspace" style="font-family:monospace"> </span></span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">;</span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)"> </span><span class="RktCmt" style="font-family:monospace;color:rgb(194,116,31)">Determines whether the given graph has a cycle.</span></td>
</tr></tbody></table></p><span style="font-family:serif;font-size:medium;background-color:rgb(255,255,255)">A </span><b style="font-family:serif;font-size:medium;background-color:rgb(255,255,255)">cycle</b><span style="font-family:serif;font-size:medium;background-color:rgb(255,255,255)"> is a path from a node to itself, and a </span><b style="font-family:serif;font-size:medium;background-color:rgb(255,255,255)">self-loop</b><span style="font-family:serif;font-size:medium;background-color:rgb(255,255,255)"> is a special case of a cycle that consists of only a single edge.</span>