CS360 Final Exam. Grading for Question 1
17 points
December 13, 1997
Part 1
2 points
Part 2
3 points. Two for saying why the colleague's comment was true.
One for saying the cases in which it would be false.
Many of you said that if malloc() padded to 4 bytes, then
you couldn't fit the extra val field into the padding. That
is correct (and I gave full credit for it), but it is very unlikely,
since all machines have 8-byte doubles. The answer I gave is the
more plausible answer.
Part 3
10 points. If you gave a good free-list implementation, that was
worth all 10. If you gave the array implementation and made some
mention of why there are problems with dl_delete_node()
that was also worth 10. If you used the array implementation and
ignored dl_delete_node(), that was worth 8.
Other deductions:
- Always calling malloc() in make_dl(), instead of
bundling it up in a subroutine and calling the subroutine from
make_dl() and dl_insert_b(). This is because
you'll lose your free list / array every time someone calls
make_dl(). -1
- Minor C bugs: -0.5
I rounded up at the end.
Part 4
2 points.
Histogram of scores