SUNY Geneseo Department of Computer Science


Induction and Algorithms, Part 2

{Date}

CSci 240, Spring 2007
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture

Misc

Problem set 5 due today

Lab 3 due tomorrow

Phi Beta Kappa Lecture

Questions?

Induction Proofs about Recursion

Example

        print( n )
            if n > 1
                output n
                print( n-2 )
                output n-1
            else
                output n

Another Example

        tower( n, source, dest, spare )
            if n > 0
                tower( n-1, source, spare, dest )
                move 1 disk from source to dest
                tower( n-1, spare, dest, source )

Hand out problem set 6

Hand out lab 4

Next

Formal tools for reasoning about the performance of recursive algorithms

Read section 7.2.1


Next Lecture