<SCENE_1>
Objective: Understand the basic concept and purpose of the linear search algorithm.
Visual_Focus: A simple array of numbers displayed horizontally with a highlighted target value.
Content: Introduce linear search as a method to find a specific element in a list by checking each element sequentially from the start. Explain the problem: given an array and a target value, the goal is to find the index of the target or determine it is not present. Use a small example array (e.g., [3, 7, 1, 9, 5]) and a target (e.g., 9).
Transition: Lead into how the algorithm proceeds step-by-step to check each element, setting up the need for a detailed walkthrough of the search process.
</SCENE_1>
<SCENE_2>
Objective: Visualize the step-by-step process of linear search on an example array.
Visual_Focus: Animated array with elements being highlighted one by one as they are compared to the target.
Content: Demonstrate the linear search algorithm iterating through the array elements sequentially. Show comparisons: element == target? If no, move to next element; if yes, return index. Emphasize the sequential checking and stopping condition. Highlight the number of comparisons made.
Transition: Introduce the concept of algorithm efficiency and motivate the need to analyze the performance of linear search.
</SCENE_2>
<SCENE_3>
Objective: Analyze the time complexity of the linear search algorithm mathematically.
Visual_Focus: Big O notation formula and a graph plotting input size (n) vs. number of comparisons.
Content: Explain that in the worst case, linear search checks every element, resulting in O(n) time complexity. Show the formula: T(n) = cn + d (where c and d are constants). Plot a graph illustrating linear growth of comparisons with increasing array size. Briefly mention best, average, and worst cases.
Transition: Prepare to compare linear search with other search algorithms and discuss when linear search is appropriate.
</SCENE_3>
<SCENE_4>
Objective: Summarize key points and discuss practical applications and limitations of linear search.
Visual_Focus: Summary bullet points alongside a decision flowchart for choosing search algorithms.
Content: Recap how linear search works, its O(n) complexity, and its simplicity. Discuss scenarios where linear search is preferred (small or unsorted data). Contrast briefly with more efficient algorithms (e.g., binary search) requiring sorted data. Encourage understanding of trade-offs in algorithm choice.
Transition: End with a prompt to practice implementing linear search and analyzing its performance on different datasets.
</SCENE_4>