linear_search(anvalstep [initializeset pos - step [initializeset step repeat step while <= step if [ival set pos print pos go to step [end of ifset [end of loopstep if pos - print "value is not present in the array[end of ifstep exit figure algorithm for linear search and the value to be searched is val then searching means to find whether the value ' is present in the array or not if yesthen it returns the position of its occurrence herepos (index starting from figure shows the algorithm for linear search in steps and of the algorithmwe initialize the value of pos and in step while loop is executed that would be executed till is less than (total number of elements in the arrayin step check is made to see if match is found between the current array element and val if match is foundthen the position of the array element is printedelse the value of is incremented to match the next element with val howeverif all the array elements have been compared with val and no match is foundthen it means that val is not present in the array complexity of linear search algorithm linear search executes in (ntime where is the number of elements in the array obviouslythe best case of linear search is when val is equal to the first element of the array in this caseonly one comparison will be made likewisethe worst case will happen when either val is not present in the array or it is equal to the last element of the array in both the casesn comparisons will have to be made howeverthe performance of the linear search algorithm can be improved by using sorted array programming example write program to search an element in an array using the linear search technique #include #include #include #define size /added so the size of the array can be altered more easily int main(int argcchar *argv[]int arr[size]numinfound pos - printf("\ enter the number of elements in the array ")scanf("% "& )printf("\ enter the elements")for( = ; < ; ++scanf("% "&arr[ ])printf("\ enter the number that has to be searched ")scanf("% "&num)for( = ; < ; ++if(arr[ =numfound = pos=iprintf("\ % is found in the array at position% "num, + )/+ added in line so that it would display the number in the first place in the array as in position instead of *breakif (found =