Week 03 Notes for CS 2500, Section 001 -- Fall 2004
Take roll.
Announcement(s)
Test Infomation
I put quiz review questions in the class web space.
My tests tend to be mostly multiple-choice and short-answer
questions, plus one or two questions that ask you to give C++
code or pseudo code for some task.
We have a quiz coming up on Tuesday. All you need to bring is
a pen.
Printing Hint: If you print text files from the command line using
the lp command then it will go faster than if you print from the
TextEdit application.
This week we are reading in Carrano about recursion (chapter 2).
This week we are reading in Andersen about CDE and the Unix file
system.
The level #2 version of program #1 is due Tuesday - hardcopy of
source on desk at start of class and and source & script (with
proper subject line) by e-mail before midnight.
Next week: Quiz on Tuesday and finished program #1 due on Thursday.
Discuss requirements of third (and subsequent, if any) levels of program
#1. Look at the "help" files in the assignment directory.
Do we need to discuss compiling inside JOVE?
The compiler command option for naming the executable file:
g++ -o decoder decoder.cpp
Discuss compiling/debugging with jove
How to execute the compiler "inside" jove: (C-u, C-x, C-e)
C-x 1 "unsplits" the screen.
How to break out of jove to a sub-shell whilst "saving your
place": (esc-s)
Testing the program while in the sub-shell.
How to break out of the sub-shell and return to "your place" in
jove: (exit)
If interested, you can read the
compileHelp document
for more information about using JOVE for compiling and debugging. This
document is in the General_Info section of the class web space.
Sometime this week, we need to look at samples of recursive
functions and programs that use them. The following files
serve that purpose:
factorialA.cpp
factorialA.out
factorialB.cpp
factorialB.out
inorderNonRecursive
inorderRecursive
runTimeStack.cpp
runTimeStack.jpg
runTimeStack.script
Instructor can access and test run some of the above in his directories: sun::/user/dept/john/Classes/CS2500/Examples and
sun::/user/dept/john/Classes/CS2500/RuntimeStack
Discuss recursion
Examine non-recursive and recursive versions of in-order
traversal of a BST. Show the non-recursive first, and then
the recursive. This is good to indicate the power of
recursion. (Source: Stubbs and Webre)
Discuss Activation Records and implementation of recursion.
Use the evaluation of factorials as the working example.
Write out a "tree" to show how inefficient it is to calculate
n choose k with recursion.