SUNY Geneseo Department of Computer Science
{Date}
CSci 141, Spring 2005
Prof. Doug Baldwin
Hand out Lab 3
Friday we made theoretical predictions about the execution time of an algorithm for filling a square, and set up an experiment to test those predictions.
Hypothesis: The execution time of this algorithm is proportional to 4n + 2n2, where n is the length of a side of the square
Procedure:
Prediction? printed ratios will be about the same for all n
Runing the program produces four ratios that decrease slightly from the one for n=6 to the one for n=12. Evaluating this result...
Chapter 5
Generic form
if test then
do something
else
do something else
(Also "if...then...else if...else if...", "switch", etc.)
What does it mean that test is "boolean?"
Logical operators?
if ( a < b && c != 1 ) ...
Truth tables
Combining logical operators (boolean algebra)
Introduction to recursion
Read Section 6.1