Pseudocode and Algorithm for Sequential Search or Linear Search

(1017 Views)

What is Sequential Search?

Sequential search is the natural searching algorithm which everyone follows in the Real life. Just go on checking the elements from fist to last. If the match is found, display that the element is found at that position else just display "Element not found"

Algorithm for Sequential Search or Linear Search

Step 1: Start
Step 2: Take element to be searched as input from User in "search" variable and the elements in array a[]
Step 3: Repeat until the last element of the array list
Step 3.1 If search==current element in the list
then, return current elements index value
else
continue with next iteration
Step 4: Stop