Data Structures and Algorithms — Homework 3

Due by 11:59pm Wednesday, February 14

Reading

Programming Exercises

  1. Finish your N-body simulation program from Lab 3, except for the last exercise (#12), which you do not need to complete.

Extra Credit (optional)

    You should finish your basic N-body program first before attempting this one.

  1. Complete exercise #12 from Lab 3. That is, implement a 3-dimensional version of your N-body simulation program called NBodySimulation3D.java. You'll also need to create a new Body3D.java class definition and modify the universe files accordingly for 3-dimensional space. The program ExpandEarth.java demonstrates how you can resize an image by passing two additional values to the StdDraw.picture method which specify the image's width and height in pixels.



Turning in Your Homework

Files to submit:

Submit the above files using the Homework Upload Site. Please include your name and the assignment number in a comment at the top of each Java source code file. You DO NOT need to submit any other files from the lab, or any of your compiled .class files.

If you have questions about anything, just ask!