Difference between revisions of "CSC270 Final Exam 2016"
Line 23: | Line 23: | ||
=Problem 1= | =Problem 1= | ||
<br /> | <br /> | ||
− | The program below implements a list of pairs of ints. | + | The program below implements a linked-list of pairs of ints. Study it, run it, play with it, and make sure you are comfortable with the code. |
<br /> | <br /> | ||
::<source lang="C" highlight="40,41"> | ::<source lang="C" highlight="40,41"> | ||
Line 82: | Line 82: | ||
</source> | </source> | ||
<br /> | <br /> | ||
− | + | As you should have observed, the program creates a linked list and then displays it. The list list is composed of numbers originally found in an array of '''ints'''. The program can use 3 different arrays of ints, defined at '''table1''', '''table2''', and '''table3'''. In its implementation above, it uses table1. If you wanted to use table2 instead, you could change the highlighted lines as illustrated below: | |
<br /> | <br /> | ||
::<source lang="C"> | ::<source lang="C"> | ||
Line 89: | Line 89: | ||
</source> | </source> | ||
<br /> | <br /> | ||
− | * Compile and run the program, and verify that it displays the list of pairs. | + | * (I will test your program with all 3 arrays.) |
+ | * Compile and run the program for all 3 arrays, and verify that it correctly displays the list of pairs. | ||
<br /> | <br /> | ||
==Your Assignment== | ==Your Assignment== |