- Searching is the process of finding a given value position in a list of values.
- It decides whether a search key is present in the data or not.
- It is the algorithmic process of finding a particular item in a collection of items.
- It can be done on internal data structure or on external data structure.
- Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored.
Algorithms are generally classified into two categories:
Sequential Search:
In this, the list or array is traversed sequentially and every element is checked.
For example: Linear Search, Sentinel Linear Search
Interval Search:
These algorithms are specifically designed for searching in sorted data-structures.
These type of searching algorithms are much more efficient than Linear Search.
They repeatedly target the center of the search structure and divide the search space in half.
For Example: Binary Search, Fibonacci Search
0 Comments