Searching and sorting Algorithm in C
Searching is a process of finding a particular record within a huge amount of data.
Data can be arrays,linked list,tress,etc.
There are 2 categories of searching. They are:
1.Sequential searching (linear search)
2.Interval searching (binary search)
Linear searching
- It is a type of sequential searching algorithm.
- Every element within the input array is traversed and compared with the item to be found . If the item matches in search,then it is successfull.
- The best case complexity is O(1) and the worst case complexity is O(n).
Example: