Additional info and advice for home exam1

This document contains additional info about home exam 1 and some pieces of advice. (It may be gradually expanded with new info, so you're advised to check for updates.)

Submission: Via the Inspera system. (Please follow carefully the instructions about naming your program files, and grouping all the files as a tar ball or a zipped file. Note: The included short report should be in PDF format.)

Deadline: Tuesday April 14, 2020. (A friendly piece of advice: Don't wait until the very last minute for submission. Remember Murphy's law.)

The exam text was slightly updated on March 4. So, if you downloaded the exam text before that, please download it again.

If your PC doesn't have a C compiler (that supports OpenMP programs), please consider remotely using a standard Linux server at Ifi (such as login.ifi.uio.no) as a testbed.

Make sure that your programs actually compile and run on a standard Linux machine. Beware that Linux servers at UiO are shared resources, please avoid running programs that take a long time.

Feel free to follow the discussions among IN3200/IN4200 students at piazza. (However, please be aware that the quality of the students' suggestions there may not be perfect.)

Q & A:

  • For the function of "read_graph_from_file1", why is the third argument ("table2D") of type char***?

This is because all arguments to a C function are passed by value (that is, a copy). Therefore, if you want to dynamically allocate an array (1D, 2D, 3D ...) inside a function, and let it be pointed by an array pointer (say, named "ptr") living outside. Then you should call the function with "&ptr" as input, and program accordingly inside the function. For the example of allocating a 1D array inside a function, please read the answer (not the question) given here.

  • Are there real examples, which are not too huge, for testing the 2D table format?

Please try some of the smaller graphs (of type "Directed") that are available at

  https://snap.stanford.edu/data/index.html

 

Av Xing Cai
Publisert 22. mars 2020 22:08 - Sist endret 10. apr. 2020 21:25