C++ Programming Code Examples C++ > Sorting Searching Code Examples Program to Find Minimum Element in an Array using Linear Search Program to Find Minimum Element in an Array using Linear Search - Search the minimum element with time complexity O(n). - Compare the element at the beginning with another array element sequentially. - Swap values if the element at the beginning is larger than the other element. - This value will be the minimum value among the given data. - Exit. C++ program to find the minimum element of an array using Linear Search approach. #include<iostream> using namespace std; int main() { int n, i, min, a[30]={89, 55, 96, 13, 7, 47, 63, 89, 19, 69, 83, 23, 38, 47, 86, 39, 27, 14, 29, 97, 865, 436, 745, 186, 486, 745, 987, 966, 366, 744}; char ch; min = a[0]; cout<<"\nThe data element of array:"; for(i = 1; i < 30; i++) { cout<<" "<<a[i]; // Assign min to the current element if its value is lesser than min value. if(min > a[i]) min = a[i]; } cout<<"\n\nMinimum of the data elements of array using linear search is: "<<min; return 0; }