find minimum and maximum value in array C++ | Arrays

preview_player
Показать описание
find minimum and maximum value in array C++ | Arrays

Hi
Welcome To our channel Code Bashers.

About This Video-
This video is about finding the minimum and maximum values from an array. In this video i have traversed through whole array and at each position checked that current value is greater than max value or not or current value less than min value or not and accordingly updated the values.

Queries Solved in This Video:
1) Approach for finding minimum value and maximum value(separately)
2) Dry run of approach
3) Code for min max in array (C++)

Complexity:
Space Complexity=O(1)
Time Complexity= O(N)

#MinMaxValue #Arrays #code

Please Like , Share , Subscribe and forward it to your friends.

Thank You

------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------

About Channel:
Our channel make videos related to programming. I hope my content helps you land the job of your dreams and become a better engineer!
Рекомендации по теме
Комментарии
Автор

Thanks a lot it take my whole day to understand this& ur 7 min video can do it😍

junaidiqbal
Автор

Thanks a million sir....u helped a lot during my exams days

al-quranreciter
Автор

Great method. I dont know why everyone uses functions in this question

AnuragSingh-jqjn
Автор

In starting of the code, you wrote
Int main(int
If we do not write that, will code run?

shubhank
Автор

Some people just stretch this problem for an hour and make it so complex to understand but this method and that method they all give same answers🤣

blackgoat
Автор

#include<iostream>
using namespace std;

int main()
{
int arr[10], n, min = arr[0];
cout << "Size of array = ";
cin >> n;
cout << "Enter numbers to find minimum number :" << endl;
for ( int i = 0; i<n; i++ ) {
cin >> arr[i];

if ( arr[i] < min) {
min = arr[i];
}
}
cout << "Minimum Number = " <<min<< endl;
return 0;
}

// This is code but minimum 0 hi ata hai

izzu-ue