
5.3. Search Algorithms¶
This lesson introduces one common group of algorithms: searches. Through a number guessing game, students explore the efficiency of binary and sequential search algorithms as well as write the pseudocode for binary search.
CSP Framework | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||||||||||
Enduring Understanding AAP-2: The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values. | |||||||||||||||||||||||||||||||||||||||||
Learning Objective AAP-2.L: Compare multiple algorithms to determine if they yield the same side effect or result. | |||||||||||||||||||||||||||||||||||||||||
Learning Objective AAP-2.O.a: For algorithms involving elements of a list: a. Write iteration statements to traverse a list. Learning Objective AAP-2.O.b: For algorithms involving elements of a list: b. Determine the result of an algorithm that includes list traversals. | |||||||||||||||||||||||||||||||||||||||||
Learning Objective AAP-2.P.a: For binary search algorithms: a. Determine the number of iterations required to find a value in a data set. Learning Objective AAP-2.P.b: For binary search algorithms: b. Explain the requirements necessary to complete a binary search. | |||||||||||||||||||||||||||||||||||||||||
Professional Development
The Student Lesson: Complete the activities for Unit 5 Lesson 5.3: Search Algorithms.
Materials
- Computer lab with projection system
- Video: How Google Search Works
- Binary Game (without feedback)
- Binary Game with too high/too low feedback
- POGIL Worksheet
- POGIL Roles
- Linear/Sequential Search Game
- Slides by Mobile CSP Teacher Mary Rucker
5.3.1. Learning Activities¶
Estimated Length: 45 minutes
- Hook/Motivation (10 minutes): Bring a phonebook or dictionary to class and ask a student look up something in the middle of the alphabet like "lawyer". The student will predictably open the book in the middle using a version of binary search. Ask the other students why didn't the student start at page 1? Ask students to think about how Google is able to search web pages for things like "cat videos" or your name. Show the video on "How Search Works"
- Experiences and Explorations (30 minutes):
- Guessing Game: In pairs, have one student select a secret number between 1 and 100. The other student should try to guess it with as few guesses as possible. Students can let them know if guesses are too high or too low...or correct! Have them switch and repeat the process. Share strategies as a class for guessing the number.
- Explanation: Explain that the students have just used a binary search strategy — guessing in the middle to rule out either the top or bottom half of numbers. This is an efficient strategy because half of the remaining numbers are able to be eliminated with each guess. Now ask students what they think would be the worst strategy for guessing in that it would take the most number of guesses. Hopefully, someone suggests sequential (linear) search — one in which you guess every number starting at one, all the way up to 100.
- POGIL Activity: Divide students into POGIL groups and have them choose roles. Students should work together to answer the questions about binary search, using the widget or by hand. When finished, they should review the widget for sequential search as well.
- Rethink, Reflect and/or Revise (10 minutes): In pairs, have the students write a paragraph giving directions for a sequential search and for a binary search. Share the paragraphs with the class and check for missing details. Have the students complete the interactive exercises and their portfolio reflections.
5.3.2. Professional Development Reflection¶
Discuss the following questions with other teachers in your professional development program.
-
I am confident I can teach this lesson to my students.
- 1. Strongly Agree
- 2. Agree
- 3. Neutral
- 4. Disagree
- 5. Strongly Disagree