PDF Notes: Long Image 3-28-26 19

    Master this deck with 12 terms through effective study methods.

    Generated from uploaded pdf

    Created by @kellz

    What is linear search?

    Examines each element sequentially until the target is found.

    What defines binary search?

    Requires a sorted array and divides the search space in half.

    How does linear search differ from binary search?

    Linear search can work on unsorted arrays, while binary search cannot.

    What happens if the value is not in the array during linear search?

    It examines all elements and returns -1.

    What is a key disadvantage of linear search?

    It is inefficient for large arrays, averaging N/2 comparisons.

    What is the benefit of binary search?

    It performs at most log2(N) comparisons, making it faster.

    What is bubble sort?

    Compares adjacent elements and swaps them if out of order.

    How does selection sort work?

    Locates the smallest element and places it in the correct position.

    What is a disadvantage of bubble sort?

    It is slow for large arrays due to many comparisons.

    How does selection sort differ from bubble sort?

    Selection sort makes fewer exchanges than bubble sort.

    What is a requirement for binary search to function?

    The array must be sorted before performing the search.

    What is the main purpose of sorting algorithms?

    To arrange values in a specific order for easier searching.