Latest Update: 03/12/2000
Week 05 Notes for CS 2500 -- Spring 2000
(this is draft material)
* Take roll
* Schedule Highlights:
* Final version of program #1 due Monday, March 13, before
midnight. Discussion?
* Final version of program #2 due Monday, March 20, before
midnight. Discussion?
* Quiz coming up on Friday, March 17.
* Any questions?
* Discuss "badRecursion.cpp" program that calculates N choose K
with a very inefficient recursive algorithm. This
illustrates the fact that recursion can be misused very
badly. Recursion can be very helpful and efficient, also
terribly inefficient. The programmer has no choice but to
"carry the arrow in the quiver" -- know when to use it, and
when not to use it.
* Write out a "tree" to help show how inefficient it is to
calculate N choose K with recursion.
* Discuss a problem of reading in a list of inventory records
and writing them back out in sorted order, formatted nicely.
This can motivate the use of abstract data types, and the use
of arrays and structs in combination to represent data.