Lesson 2: Searching

Overview

How can I determine the efficiency of an algorithm?

You have used searching in standard algorithms to find a target element in a list. In this lesson, you explore the linear search algorithm and how it can be applied to different data structures. You learn how to use execution counts to determine the best, average, and worst cases and practice evaluating algorithms for their efficiency. You then write user stories for your project to identify required program features.

Vocabulary

  • Average Case - The average number of executions an algorithm can take to complete its goal
  • Best Case - The least number of executions an algorithm can take to complete its goal
  • Execution Count - The number of times a code segment runs
  • Linear/Sequential Search - A search algorithm that checks each item in order until the target is found
  • Worst Case - The most number of executions an algorithm can take to complete its goal

Resources