nov 22
finish talking about recursion
1. Discuss homework problems
- palindrome (see my attached example)
- length of list
2. Browse a few more examples of recursion
- towers of hanoi
- koch curve
- peg jumping solitaire
- coin counting (projeceuler.net # 31)
discuss other ideas from chap 13 ("on to computer science")
Once you have the basics of "how to write a program",
then what?
The analogy is writing: once you know
how to put together a subject, verb, and object,
you can write a sentence. But the content
of what you can write about is a much bigger topic.
Likewise, "computer science" as a field is about
how to best represent and implement various
information-related tasks. The recipes for
doing these sorts of things are called "algorithms",
and so the next step is often to look at them.
For example, given a collection of numbers, how do we find
if something specific is in there?
First: try as a class exercise. How many different
algorithms can you suggest? How can we measure how
good they are?
Linear search is O(n); binary search is O(log(N)).
Define these terms and give specific examples.
I've attached the programs we dicsussed in class.