% Calcx 1234567890123456 + 1 Input: 1234567890123456 + 1 Result: 1234567890123457.00 12345678901234567 + 1 Input: 12345678901234567 + 1 Result: 12345678901234568.00 123456789012345678 + 1 Input: 123456789012345678 + 1 Result: 123456789012345680.00 1234567890123456789 + 1 Input: 1234567890123456789 + 1 Result: 1234567890123456768.00The above is output from the staff solution to hw4. Things get a a bit crazy after 17 decimal digits. Why? lp0227 tells us why.
The office hours are Sun/Tue/Thu 8-11 PM at Hillhouse 17 Rm 111.
We had to revise the questionnaire last Thursday. If you filled it out before then, please resubmit. This is an opportunity to provide useful feedback about both what you like and what you do not like.Based on preliminary review of the initial survey, there is a bimodal distribution of opinion. Either you think the pace is too slow, or too fast.
Many of you came from CS 201 with no C experience. Others came from CS 50. You have different needs and expectations. My view is that we have a textbook for C (K&R). I am not going to lecture from that. (This was Alan Perlis' view. I remembering thinking that I would have liked him to do so.)
Some of you object to my reading from the lecture notes (as I am no doubt doing now.) I prepare the notes to insure that I cover the points that I believe are important. Otherwise, I will likely forget something or make a mistake. I do try to untether myself from the podium and use the blackboard.
Last term, some students wanted less emphasis on how to solve the homework problems, and more on the theory. This term, it is often the reverse. I try to help you navigate the problem sets - providing milestones and landmarks, telling you what pitfalls to avoid.
Believe it or not, we have made a special effort this term to make the homework specs more stable and clear. The ULAs have been very helpful in anticipating and correcting ambiguities and unclear language. There has actually been a big improvement as indicated by fewer revisions.
Individual feedback. Some of you get this during office hours. The automatic grading is not so helpful in this regard. I think that one on one code review is probably the most effective. We might try peer code review after assignments have been graded.
Other possible mid-term changes: sections on specific topics (UNIX, pointers, valgrind, debugging, etc.) Different office hours schedule. We welcome your suggestions.
Why study stacks in the first place? I failed to mention that stacks are pervasive in computer science. Function calls depend on pushing the current execution state on the stack, and then popping the stack upon completion. No stack = no recursion.
See discussion of stacks, converting infix to postfix, and evaluating a postfix expression.
struct stack { struct stack * next; int size; int top; int *elements; }Imagine an instance where size = 4, and you have pushed the first 9 positive integers. When a stack is full, allocate a new one and have its next point to the old one.