Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Linear Search in C and C++ Languages

Linear search simply means 'looking for an element in the whole array from one end to the other'. The searched element is compared with the first element of array first, then with the second, then with the third, so on upto the end of the array. This is time consuming when the array is pretty enough. The time complexity is highest.The C and C++ programs for linear search is given below.

C Program:

#include<stdio.h>

void main()
{