Quiz
04 Array algorithms
|
|||||||||
This quiz will be given on 06 November!!! Reason for quizzes. A course like CS100 uses a lot of terminology and introduces many new concepts. Typically, the terminology and concepts are used from the day they are introduced onward. If you don't learn them soon after they are introduced, you can't understand later lectures and material. So, each quiz alerts you to what is important for you to learn at that time (and forces you, hopefully, to learn it). We hope that you don't only superficially learn it but grok it. (If you don't know what grok means, bring up ProgramLive (the CD), open the glossary, and look at the entry for grok. For quiz 04, you have to be able to write down these three algorithms, each given as a loop with initialization.
1. Learn the specification of the method. Practice writing it! 2. Learn the invariant for the loop. Often, it need not be memorized because it is a simple modification of the postcondition of the algorithm. Practice writing the invariant! The preconditon, postcondition, and invariant can be given either in math and English or as a picture. 3. Practice developing the code, using the four loopy questions. Note: the text gives each of these algorithms as a method. The only return statement in each method is at the very end, after the answer has been calculated. There are NO return statements in the loops, and we don't expect you to write them in the loop. |
|||||||||