Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

SICP

Name: Anonymous 2007-11-24 19:27

Hello /prog/
I am reading SICP, should i do all exercises of the book?
I can't wrap my head around the code.
I've even googled for solutions, but i have to write them down and follow/write each call with pencil.

Seriously, i wouldn't have problem with most of the algorithms given if i could use some other language.

Do i fail at maths?
help.

Name: Anonymous 2007-11-25 20:46

>>21
In general, an iterative process is one whose state can be summarized by a fixed number of state variables, together with a fixed rule that describes how the state variables should be updated as the process moves from state to state and an (optional) end test that specifies conditions under which the process should terminate.

Think about it.

The state of the program can be summarized by four variables: i, f(i - 1), f(i - 2), and f(i - 3). Given these variables, it is trivial to compute f(i). The state transformation substitutes (i + 1) for i, f(i) for f(i - 1), f(i - 1) for f(i - 2), and f(i -2) for f(i - 3). For n > 3, f(n) can be computed by setting i := 3 and iterating; computation stops when i = n.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List