This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

6.001, Spring 2004—Recitation 3 1MASSACHVSETTS INSTITVTE OF TECHNOLOGYDepartment of Electrical Engineering and Computer Science6.001—Structure and Interpretation of Computer ProgramsSpring 2004Recitation 3RecursionScheme1. Special Forms(a) cond - (cond clause clause ...)Each clause is either (test consequent) or (else alternative). Tests each clause in orderand if the test evaluates to not false, evaluates the consequent.Problems1. Write a procedure fact that computes the factorial of a number n.Plan:2. Write a procedure remainder that computes the remainder of num divided by divisor.Plan:3. Write a procedure that computes e.Plan:6.001, Spring 2004—Recitation 3 24. Write an iterative procedure that computes e.Plan:5. Write a procedure fib that computes the nthfibonacci number.Plan:6. Write a procedure that computes the golden ratio, φ.Plan:7. Write a procedure that computes


View Full Document

MIT 6 001 - Study Notes

Documents in this Course
Quiz 1

Quiz 1

6 pages

Databases

Databases

12 pages

rec20

rec20

2 pages

Quiz II

Quiz II

15 pages

Streams

Streams

5 pages

Load more
Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?