Explanation

- Linear Search is a simple searching algorithm used to find an element in a list or array. This algorithm checks each element of the list one by one until it finds the target element.

-

  • Steps:

    • Start from the first element of the list.
    • Compare each element with the target element.
    • If an element matches the target, return its index.
    • If no element matches the target, return -1 (element not found).
  • Time Complexity:

    • The time complexity of Linear Search is O(n), where n is the number of elements in the list or array.