Monday March 31, 2014
Algorithms are often thought of as recipes that programmers write for computers to follow. This problem challenges you to create an algorithm for an established model and its data structure.
Two previous challenge problems have developed a model and data structure for simulating the behavior of particles colliding in an environment and precipitating. These challenge problems are linked below:

http://hpcuniversity.org/students/weeklyChallenge/70/
http://hpcuniversity.org/students/weeklyChallenge/71/

Your task is to develop an algorithm for a simulation of the behavior previously described. The algorithm should be written in pseudocode, such that a human can easily read it, and such that it would not take much effort for a programmer to translate it into a procedural language like C, C++, Fortran, Java, or Python.

The algorithm should break tasks down into sub-tasks whenever possible and should utilize the data structure given.

An example algorithm is given below for finding the greatest common divisor of two numbers m and n, adapted from The Art of Computer Programming by Donald Knuth.

0. [Ensure m is bigger] If n is greater than m, swap m and n.
1. [Store remainder] Divide m by n, store the remainder in r.
2. [Remainder 0?] If r is 0, the algorithm terminates with answer n.
3. [Reduce] Store n's value in m, r's value in n, and loop back to step 1.
Show solution
Challenge Resources:
©1994-2024   |   Shodor   |   Privacy Policy   |   NSDL   |   XSEDE   |   Blue Waters   |   ACM SIGHPC   |   feedback  |   facebook   |   twitter   |   rss   |   youtube   |   XSEDE Code of Conduct   |   Not Logged In. Login