Frequently Asked Python Program 6: Find Maximum & Minimum Elements in an Array

preview_player
Показать описание
Topic : Find Maximum & Minimum Elements in an Array

#########################
Udemy Courses:
#########################

Manual Testing+Agile with Jira Tool
************************************

Selenium with Java+Cucumber
********************************

Selenium with Python & PyTest
********************************

Selenium with python using Robot framework
****************************************

API Testing(Postman, RestAssured & SoapUI)
*****************************************

Web & API Automation using Cypress with Javascript
********************************************

Playwright with Javascript
**************************

Jmeter-Performance Testing
************************

SDET Essencials(Full Stack QA)
*************************

Appium-Mobile Automation Testing
************************************

Java Collections
*****************

Python Programming
*********************

Cucumber BDD Framework
***************************

Protractor with Javascript
***************************

####################################
Youtube Playlists:
####################################

Manual Testing & Agile
***********************

SQL
*************************

linux & Shell Scripting
**********************

Java
**********************

Selenium With Java+Cucumber
********************************

Python
********************************

Selenium With Python,Pytest&Behave
***************************************

Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************

API Testing (Postman,SoapUi,&Rest Assured)
**********************************************

Mobile App Testing Appium
****************************

Performance Testing Jmeter
*******************************

Maven,Jenkins,Git,Github,CI/CD
*******************************

SQL,DB Testing&ETL,Bigdata
*******************************

JavaScript Based Automation Tools
********************************

Selector Hub Tools
********************

GraphQL
******************

Cypress API Testing
********************

Cypress Web Testing
**********************

Playwright with Javascipt
**************************

#PythonMaxMin
#ArrayMaxMin
#FindMaxMinPython
#ArrayOperations
#PythonCoding
#Algorithm
#DataStructures
#CodingTips
#PythonProgramming
#CodeSnippet
#TechHelp
#ArrayManipulation
#ProgrammingLogic
#PythonArrays
#CodeSolutions
#ArrayFunctions
#CodeLearning
#PythonTips
#BeginnerCoding
#PythonCommunity
#CodeExamples
#ArraySearching
#ProgrammingInPython
#PythonTricks
#CodeGuidance
#LearnToCode
#PythonExploration
#ArrayIteration
#CodingSkills
#PythonHelp
#CodeDevelopment
#ArrayAlgorithms
#PythonSnippets
#CodingJourney
#ArrayChallenges
#PythonArrays101
#CodeMastery
#AlgorithmDesign
#PythonMentorship
#ArrayProblems
#CodingCommunity
#PythonDemos
#AlgorithmSolutions
#ArrayTricks
#CodeUnderstanding
#PythonPractice
#ArrayTips
#CodeOptimization
#PythonLogic
#ArrayManipulation
Рекомендации по теме
Комментарии
Автор

we can also find this with keywords min and max:

a=[2, 4, 6, 1, 3, 8, 5]
print("the maximum value is : ", max(a))
print("the minimum valie is : ", min(a))

anupriyar
Автор

array = [2, 3, 4, 5, 6, 7, 8, 9]
min = array[0]
max = array[2]
for I in array:
If I > max:
Max = I
print("the largest number is the array is", max)
for I in array:
if I < min:
min = I
print(min)

cartoonox
Автор

Kindly answer this question

We have an array of 5 elements: [4, 8, 1, 7, 3] and we have to insert all the elements in the max-priority queue. First as the priority queue is empty, so 4 will be inserted initially.
Now when 8 will be inserted it will move to front as 8 is greater than 4. While inserting 1, as it is the current minimum element in the priority queue, it will remain in the back of priority queue. Now 7 will be inserted between 8 and 4 as 7 is smaller than 8.
Now 3 will be inserted before 1 as it is the 2nd minimum element in the priority queue.

syedowaisaliraza
Автор

a=[30, 20, 15, 40, 10]
b=sorted(a)
s=len(a)
print(b[0])
print(b[s-1])

createsushil
Автор

why cant we use...
a = [1, 2, 3, 4]
print(max(a))

print(min(a))

SanthoshSK
Автор

a=[1, 2, 3, 4, 5]
print(min(a))
print(max(a))
it gives direct max and min values from the array know can't we write like this sir why should we write that lengthy can u explain?

smsbmamidipaka
Автор

arr = [1, 2, 3, 4, 5, 6]

minValue = arr[0]
maxValue = arr[-1]

print(f"The min value is => {minValue} The max value is => {maxValue} ")

sardard
Автор

max = 0
for i in arr:
if i > max:
max = i
print(f"The Maximum Value is : {max})

min = 0
for i in arr:
if i > min:
min = i
print(f"The Minimum Value is : {min})

richcohen
Автор

L=[1, 2, 3, 4, 5]
Print max( L)
Print min ( L)

BDIt-vjhk
Автор

Sir kindly upload dynamic input of list to find maximum and minimum

unknownuser
Автор

def sum_array(arr, i, max, min, second_max):
if i >= len(arr):
return max, min, second_max
if arr[i] > max:
max = arr[i]
if arr[i] < min:
min = arr[i]
if arr[i] > second_max and arr[i] < max:
second_max = arr[i]
return sum_array(arr, i+1, max, min, second_max)

arr = [4, 2, 6, 9, 2, 7, 1]
print(sum_array(arr, 0, arr[0], arr[0], arr[0]))

kvelez
Автор

Max and Min value okay can please explain how to find second largest and second minimum from the array

obbinenireddy
Автор

You saved my ass Sir. Thanks. God bless you my man!

jawadkobeissi
join shbcf.ru