Wednesday, June 16, 2004

Exercise[33]

Sequential Search

Pre-work

  1. In Barron's AP Computer Science A, read about Sequential Search on p. 329.
  2. Read about sequential search in one or more of the following books, which will be made available to you in class:
    • Volume 3 (first edition) of The Art of Computer Programming (by D. E. K.), pp. 393-402.
    • Volume 3 (second edition) of The Art of Computer Programming (by D. E. K.), pp. 396-405.
    • Programming Classics (by Ian Oliver), pp. 196-198 and p. 200.
  3. Implement sequential search in Java with and without the use of a sentinel value.
  4. Read the multiple choice questions on sorting and searching on pp. 331-345 of Barron's AP Computer Science A. Attempt to answer the questions that are related to sequential search and then check your answer(s) using the answers provided on pp. 346-350.

Questions

  1. [1 point] Which questions in Barron's AP Computer Science A (pp. 331-345) involve or are related to sequential search? List the question numbers only.
  2. [2 points] List two topics related to sequential search that are discussed by Donald E. Knuth (in The Art of Computer Programming) or Ian Oliver (in Programming Classics) that are not discussed in Barron's AP Computer Science A.
  3. [2 points] What is a sentinel value and how can one be used in a sequential search algorithm?

Create Activity

  1. [3 points] Create a multiple choice question about sequential search. You question should include five choices (a - e) for the answer and only one correct answer. Your question may be inspired by a question from Barron's AP Computer Science A but must be substantially different, i.e. you should feel confident that no one would ever accuse you of plagiarizing the question.
  2. [3 points] Create another multiple choice question about sequential search. You question should include five choices (a - e) for the answer and only one correct answer. Your question must be related to a topic not discussed on p. 329 of Barron's AP Computer Science A.
  3. [3 points] Create an answer key for your two questions. For each question, the answer key should explain why the correct answer is correct and why the incorrect answers are incorrect.