|
|
Recent Announcements:
-
9 May Several of you have sent me
emails asking about what to expect on the final exam.
Here are some answers:
-
The exam is comprehensive and will cover the
entire course. However, lectures 1-11 were
already covered by the midterm, so you can expect
the final to emphasize the topics from lectures
12-25 and corresponding class demos. Similarly,
the midterm covered problem sets 1-3, 4a, and 4b,
so the final will emphasize the material from
problem sets 5-9.
-
Relevant sections of the textbook that were
covered on the midterm are Chapters 1-3, Sections
8.1-8.4, and parts of Section 9.5. For the final,
I will add to that Chapters 4, 9-14, 16. These
chapter numbers are just a rough guide to
textbook material that supports what was covered
in lecture and in the problem sets. The exam will
not include material from those sections
that was not otherwise mentioned in the course,
nor are you responsible for knowing the
abstraction style used by the author where it
differs from the style that I have been
teaching.
-
The format of the final will be similar to
that of the midterm. Last year's final asked to
work 8 problems out of 10 choices. This year's
will be similar. The questions will be designed
to test your understanding of the important
concepts of the course and to be doable under
exam conditions. They might involve reading or
writing code fragments, questions about abstract
concepts, or writing short essays. I will try not
to ask questions that require memorization of
obscure detail, but of course the ability to read
and write C programs does require a considerable
amount of detailed knowledge that I consider
basic. As a general guideline, I will expect you
to remember and understand details about C that
were needed in order to do the problem sets or
that were specifically discussed in class, but
not ones that only appeared in the demo
programs.
-
I will not be posting last year's exam or a
sample exam. Sorry!
-
6 May I just posted the notes for
lectures 24 and 25 to the usual places. (See Lecture Notes page.) The demos
have been up for some time.
-
3 May Final exam announcements:
-
Yinghua Wu will conduct a review session for the final
exam on Monday, May 7, at 7:30 pm in room AKW
200. Please let me know if you want to attend a
review session but cannot come at this time.
-
The final examination will be given at
Thursday, May 10, 9:00 am in
room WLH 119. as shown in the Official Yale College Spring
2007 Exam Schedule. Note that the room is
not the regular classroom. The
exam is a "2-hour" exam for which you will
be given a total of 2 1/2 hours. Good luck!
-
26 Apr. A few people have been having
difficulty with PS9 because their heap and/or symtab
solutions to PS8 are not completely debugged. I have
decided to offer the .o files from my own solutions
to PS8 that you can link to in case you're having
such problems. I have put them along with the
corresponding header files in the Zoo course
directory
/c/cs223/assignments/ps9/. I think
they're correct, but they haven't been extensively
tested. If you do find bugs, please let me know.
-
22 Apr. Important announcement
regarding PS9: There were some serious
problems and confusions with the test data I posted
for PS9 as well as with the specifications in the
assignment itself:
-
The program failed to check for the duplicate
'accept' event in data1.in and
instead erroneously counted it as another
scholarship acceptance.
-
The program failed to announce the scholarship
acceptance of a student who was awarded a
scholarship after the offer of admission had
already been accepted.
-
The specifications lumped together under "new
scholarships" those that became available because
of 'available' events along with those that
were released by declining students. This made
the program output confusing to read. Adding to
the confusion was my using the words "unfilled"
and "available" synonymously.
As a result of these problems (for which I
apologize), I am making the following changes and
additions to the problem specification and test
data:
-
Input lines that do not begin with a
syntactically valid event record should cause an
appropriate error message to be printed to
stdout but otherwise ignored.
-
Input lines with a semantically invalid event
record should cause an appropriate error message
to be printed to stdout but
otherwise ignored. Examples of semantically
invalid events are duplicate 'accept' or
'decline' records for the same student, 'accept'
or 'decline' records for a student who was not
previously admitted, and so forth.
-
The output in response to an 'available' event
should be a line like
1 new scholarships, total available
3
The output in response to a 'decline' event
for a scholarship student should be a
Scholarship declined... line
followed by a line like
1 declined scholarship available for
reassignment, total available 3
-
A "Scholarship accepted..." line
should be printed for every accepted scholarship
student at the time the scholarship is accepted.
The time of acceptance is the time at which the
offer of admission was accepted for a student who
was awarded a scholarship prior to acceptance,
and it is the time the scholarship was awarded
for a student who was awarded a scholarship after
acceptance.
-
I have corrected the sample output files
data1.out
and data2.out
in /c/cs223/assignments/ps9.
The old (incorrect) output files have been
renamed with a .OLD suffix and left
in place for reference. I have also added a third
test data set to exercise some of the error
conditions: data3.in
and data3.out
-
The due date for
PS9 is extended to Thursday, April 26
(before midnight).
-
16 Apr. More notes on PS8:
-
I've posted a correction to
testheap that eliminates the memory
leak problem I pointed out yesterday. It does
this by using stack storage for the values that
go into the heap. In this case, one does not want
heap to assume ownership of data
values since it would be incorrect for
heap to attempt to free
stack-allocated storage.
This new test program is not very general
since it imposes an arbitrary limit on the number
of insert operations that can be tested. However,
it does illustrate a situation in which one does
not want heap to free the element
values.
The old testheap.c has been
renamed to testheap-old.c.
The new
version contains the corrections above and
also renames key to
value to clarify that it is a
pointer to the entire element object, not just to
a field within it (as the word "key" might
imply).
-
A student found a bug in the posted file
symtab.c which I have now corrected.
When a new element is inserted with the same key
as an element already in the symbol table, the
old element is deleted from the symbol table
before the new element is inserted. The code used
to call free() on that element,
which is not correct. It should instead call the
client-supplied free_element()
function. The original version has been renamed
as symtab-old.c
so that it may be easily compared with the
corrected symtab.c.
-
More on element ownership for PS8: In this
problem set, heap does not
assume ownership of its elements, and no attempt
is made to free them when they are removed from
the heap. By way of contrast, symtab
performs the service of calling the
client-supplied free_element()
function every time an element is removed from
the symbol table. Whether or not that element is
actually freed is entirely determined by how
free_element() is defined. If the
client wants the element to be freed, then it
should supply a free_element()
function that does so. If the client does not
want the element to be freed, then
free_element() can be a no-op.
-
15 Apr. Notes on PS8:
-
The sample testheap program I
supplied has a memory leak. You should fix this
when you modify it to test the extended version
of heap that you are writing for
this assignment. The reason for the leak is that
testheap and heap do
not agree on who "owns" the elements and
therefore who is responsible for deleting them.
testheap thinks that
heap will free them, whereas
heap takes no responsibility for
them, believing that is the client's job.
Who is right? The version of heap
in demo 18.1_heap did assume
ownership of its elements and did delete them
when the heap was freed. However, I changed that
behavior in the version of heap that
I provided for PS8. The reason is that I want to
be able to put the same elements into both a
symtab and a heap. They
can't both own the element or else it might get
freed twice (not a good thing). Unfortunately, I
neglected to change testheap to take
responsibility for its elements when I made the
change to heap.
-
It is important to distinguish between the
heap data structure and the client of the heap.
The heap doesn't know anything about slots or
extra fields in the value records. It just
notifies the client every time an element in the
heap moves. The client may choose to ignore the
notification, it might record the location within
the element record itself, or it might record the
location somewhere else. The only reason the
client might even care where an element lives in
the heap is if it has an element in hand and
wants to use the new delete_heap()
function to delete it. Since
delete_heap() takes a slot number
argument, if the client wants to delete a
particular element, it must know the slot number
that contains that element.
In the files I furnished, heap.h
and heap.c comprise the heap module.
Other files such as testheap.c and
record.c comprise the client.
Different clients will use different element
types and have different element descriptors.
However, all should work correctly with same
heap module.
-
8 Apr. Problem
set 9 (.pdf) is now
available. It is due on Tuesday, Apr. 24. Files
to accompany this assignment are on the Zoo in
/c/cs223/assignments/ps9.
-
8 Apr. Problem
set 8 (.pdf) is now
available. It is due on Tuesday, Apr. 17. Files
to accompany this assignment are on the Zoo in
/c/cs223/assignments/ps8.
This is the first part of the scholarship award
program that I described in class last Thursday. The
second part will comprise problem set 9, which will
be due on Apr. 24. I hope to have it posted shortly,
but PS8 does not depend on it.
-
-
5 Jan. A final examination will be given at
the officially scheduled time, Thursday, May
10, 9:00 am (room to be announced).
Please take this into
account when making your end-of-term travel plans. I
do not plan to give an early exam for the
convenience of those who want to leave campus
early.
-
[Old Announcements]
|
|
|
Teaching Assistants |
| Name: |
Pavel Dimitrov |
Yinghua Wu |
| Email: |
pavel.dimitrov@yale.edu |
y.wu@yale.edu |
| Office: |
AKW 504 |
AKW 410 |
| Phone: |
432-4712 |
432-1239 |
| Hours: |
MTh 3:30-5 pm |
WF 3:30-5 pm |
|
TA in Zoo:
Tu 7-9 pm |
|
|