Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For each version, determine how many calls to your function is made for the input

...

(list 1 2 3 ...

...

n

...

)

...

for various values of

...

n

...

.

Can you write a mathematical equation that
describes this number of calls?
(This exercise is a small example of what you'd learn to do
in COMP 280.)

...

...

  • Develop a third version that does not use

...

  • local

...

  • ,

...

  • but does use Scheme's built-

...

  • in max function.

...

Is this version relatively efficient?

...


In general, you can take any program using
local
,
and turn it into an equivalent program withoutlocal
without local.
Usinglocaldoesn Using local doesn't let us write programs which were impossible
before, but it does let us write them better.

...

List of descending numbers exercises

...

. We'll develop functions returning the list of positive numbers 1...

...

n

...

(left-to-right), given

...

n

...

as input.

...

Develop a function that, given

...