← Back

Implement linear search algorithm.

Given an array of integers, do linear search on it.

Algorithm

  1. Linear Search:
    • Iterate through the array from start to end.
    • For each element, check if it matches the target value.
    • If found, return the index or indicate success.
    • If not found after the loop, indicate failure.

Time Complexity

Enter numbers separated by commas