CS 223 - Spring 2017. 3/8
Welcome to CS 223!
Larry Wall Quote of the day
Yes, you can think of almost everything as a function, but this may upset
Logical problem of the day
#define BUFSIZE 2048
int n = BUFSIZ;
printf("n = %d\n", n);
What's up up there?
Lecture 15: HW5 + Data Structures: btrees
The office hours are
Sun/Tue/Thu 8-11 PM at Hillhouse 17 Rm 111.
My office hours this week are Wednesday 3-5pm.
Mid term exam
- Grades have been posted to classes v2.
- Will return exams in class on Wednesday.
- Problem 1a
- Problem 1b
- Problem 2 is in K&R, string reverse
- Problem 3 lists I
think with number 3, the main issue people had was with what
to malloc, how much space to malloc, traversing a linked
list (without moving the head of the linked list), when to
reference/dereference/what does * mean?, deleting.
However, that being said, this is all stuff that they should have
known because this is all stuff they should have done for Callme.
Some students were confused when
they should and when they shouldn't. Besides, I saw some very tricky
mistake that students free the pointer in a list and then call that
pointer's next. Temporary variable should be set for the next before
freeing the pointer.
- Problem 4 hash For
number 4, what most people got wrong was how to free the malloc'ed
structures, as well as what to malloc exactly.
- Problem 5 string data type
For number 5, mallocing seemed like the primary issue
(primarily mallocing space for the struct itself, in
addition to the string). There was also confusion because
the problem's function headers included only the parameter
types; when writing the functions, students should remember
to give each parameter a name, instead of trying to use the
name of the datatype.
- Problem 6 Nodup
Many of you emailed me regarding hw3 grading issues. Subsequently,
there has been related discussion on piazza. You should rely on
those postings, which means that you should resubmit (by this Friday). If your issues
are different, then contact email@example.com.
There has been some discussion on piazza about the debug option
showing the updated string values in the stack after the numeric value has
changed, for example,
The TA's/ULA's have recommended that we modify the spec to do the
right thing. They will post an update to piazza. The debug tests
will be modified accordingly. BTW, my previous suggestion about
implementing ftoa() has been superceded by the suggestion of using
sprintf(). For those of you who have finished hw4, adding and testing this
modification should not take more than 30 minutes or so.
Problem set 5
Here is an example:
Alice In Wonderland cloud
Here is an example:
Alice In Wonderland cloud with threshold=10
Lecture Starts Here