Linear Search | Sequential Search
Assume that, I am going to give you a book which has unordered page numbers. And it has 100 pages.
First page marked as number 56.
Second page marked as number 89.
And so on.
Now, what will you do if I ask you to find the page number 50?
Since the page numbers are unordered, we don’t have any choice other than searching it page by page.
Take first page. If it is page number 50. We are done.
Or else goto the next page and do the same process until we find the page number 50.
If we run out of page, we can conclude that page number 50 is not in the book.
This is called as Linear Search or Sequential Search.