0% found this document useful (0 votes)
5 views2 pages

Sequential Search

Sequential search, or linear search, is a basic algorithm that finds an element in a list by checking each element one by one. It operates by comparing the current element with the target until a match is found or the list ends, returning the index of the found element or a message if not found. The time complexity varies from O(1) in the best case to O(n) in the worst and average cases.

Uploaded by

Saritha Dev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Sequential Search

Sequential search, or linear search, is a basic algorithm that finds an element in a list by checking each element one by one. It operates by comparing the current element with the target until a match is found or the list ends, returning the index of the found element or a message if not found. The time complexity varies from O(1) in the best case to O(n) in the worst and average cases.

Uploaded by

Saritha Dev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SEQUENTIAL SEARCH

Sequential search, also known as linear search, is a simple searching algorithm used to find an
element in a list or array.

It works by checking each element in the list one by one until the target element is found or the
entire list has been searched.

How It Works:
Start from the first element of the list.
Compare the current element with the target element.
If they match, return the index of the element.
If they don’t match, move to the next element.
Repeat the process until the element is found or the list ends.
If the element is not found, return a message indicating it is not in the list.

Time Complexity:
Best case: O(1)O(1)O(1) (if the target is the first element)
Worst case: O(n)O(n)O(n) (if the target is at the end or not in the list)
Average case: O(n)O(n)O(n) (since we may have to check half of the elements on average)

You might also like