Question
Asked by:
2000Angie
2000Angie
Rating : No Rating
Questions Asked: 13
Tutorials Posted: 0
 

$30.00 Java graphs

Q:
unit 14 2 assignments and a bonus. 1st assignment is Repesenting a graph and the second is Representing a Tree and the bonus is Manipulating a Tree. the bonus is just opptional for me at this point. thanks! attached is the asignment in more detail and the code source the professor prvided.
 
Attachments:
Lab14.doc (278K)
Lab_14_Templates.zip (33K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
DoctorD
DoctorD
Rating (9): A-
Questions Asked: 0
Tutorials Posted: 28, earned $420.43
 

$30.00 Generating random graphs on a circle.

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Nov 19, 2008 at 11:34:49PM
A:
Preview: ... int y = (int) (radius * Math.sin(count * 2 * Math.PI / numOfVert));<br> Construct a Point2D object from x and y.<br> Call vert.addElement with the new Point2D object.<br>End Loop<br><br>The next part is to draw some edges between a few randomly selected points.<br>Here's the pseudocode:<br>Loop count from zero to actualNumberOfEdges<br> Randomly select a start vertex (v1) and an end vertex (v2):<br> int v1 = (int) (Math.random()*numOfVert);<br> int v2 = (int) (Math.random()*numOfVert);<br> Construct a "non-special" Edge object from v1 to v2. <br> (Refer to the constructor of the Edge class.)<br> Call edges.addElement with the new Edge object.<br>End Loop<br><br>When you run the applet, <br>follow the assignment directions ...

The full tutorial is about 632 words long .
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty