Frequently Asked Java Program 18: How To Find Maximum & Minimum Values in Array
ฝัง
- เผยแพร่เมื่อ 14 ต.ค. 2019
- Topic : How To Find Maximum & Minimum Values in Array
#########################
Udemy Courses:
#########################
Manual Testing+Agile with Jira Tool
************************************
► shorturl.at/xNXZ4
Selenium with Java+Cucumber
********************************
► shorturl.at/aIKMW
Selenium with Python & PyTest
********************************
► shorturl.at/ELW09
Selenium with python using Robot framework
****************************************
► shorturl.at/bcDPZ
API Testing(Postman, RestAssured & SoapUI)
*****************************************
► shorturl.at/uAWY7
Web & API Automation using Cypress with Javascript
********************************************
► rb.gy/4uum2n
Playwright with Javascript
**************************
► shorturl.at/gALZ1
Jmeter-Performance Testing
************************
► rb.gy/ocj7r2
SDET Essencials(Full Stack QA)
*************************
► rb.gy/hlnf2v
Appium-Mobile Automation Testing
************************************
► rb.gy/wmzv64
Java Collections
*****************
► bit.ly/3S66ezE
Python Programming
*********************
► urlis.net/gdsfpb0s
Cucumber BDD Framework
***************************
► bit.ly/3F7d69r
Protractor with Javascript
***************************
► urlis.net/4uddm1qb
####################################
TH-cam Playlists:
####################################
Manual Testing & Agile
***********************
► bit.ly/3ujvaYa
► bit.ly/3OYzxQj
SQL
*************************
► bit.ly/3R6XjeG
► bit.ly/3nE0a1s
► bit.ly/3IeKuuJ
linux & Shell Scripting
**********************
► bit.ly/3up1Z6a
► bit.ly/3nzvGxx
Java
**********************
► bit.ly/3R9QfOs
► bit.ly/3AoRMKM
► bit.ly/3IbTTDn
► bit.ly/3ybXInv
► bit.ly/3yCoHdw
Selenium With Java+Cucumber
********************************
► bit.ly/3P2FMm4
► bit.ly/3yhiIt4
► bit.ly/3uokzet
► bit.ly/3a7XIND
► bit.ly/3umN2S9
► bit.ly/3aar7GW
► bit.ly/3y9kD2S
► bit.ly/3uhLskn
Python
********************************
► bit.ly/3agNgU0
► bit.ly/3NJNnoy
► bit.ly/2CTQ4mR
► bit.ly/3OIYWh1
Selenium With Python,Pytest&Behave
***************************************
► bit.ly/3OHHoC9
► bit.ly/3IeNLdv
► bit.ly/2J4tPeT
► bit.ly/3ydSkAq
Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************
► bit.ly/3nUvlpr
► bit.ly/3nUvE3z
API Testing (Postman,SoapUi,&Rest Assured)
**********************************************
► bit.ly/3OXacWY
► bit.ly/3yh0UhE
► bit.ly/3nC9DWQ
► bit.ly/3yGfhNS
► bit.ly/3OJa11H
► bit.ly/3P2slCC
Mobile App Testing Appium
****************************
► bit.ly/3Al49HG
Performance Testing Jmeter
*******************************
► bit.ly/3nz4fE7
Maven,Jenkins,Git,Github,CI/CD
*******************************
► bit.ly/3P16HPj
► bit.ly/3yhlUVA
► bit.ly/3afYfwT
► bit.ly/3yGzweG
► bit.ly/3yF73Ws
► bit.ly/3NCOmH7
SQL,DB Testing&ETL,Bigdata
*******************************
► bit.ly/3NKOcNY
► bit.ly/3OVpDyI
► bit.ly/3NEvUy0
► bit.ly/3IryxlT
► bit.ly/3RkWBLh
JavaScript Based Automation Tools
********************************
► bit.ly/3nUx51X
► bit.ly/3AqI6Q0
► bit.ly/3yeurbT
► bit.ly/3ujzpTK
Selector Hub Tools
********************
►rb.gy/h3h424
GraphQL
******************
► rb.gy/sj3gys
Cypress API Testing
********************
► shorturl.at/fjKPX
Cypress Web Testing
**********************
► shorturl.at/agjlK
Playwright with Javascipt
**************************
► shorturl.at/adSTY
#PythonMaxMinArray
#ArrayMinMaxPython
#MaxMinValues
#ArrayOperations
#PythonArrayManipulation
#CodingPractice
#ArrayAlgorithms
#PythonProgramming
#CodeExamples
#AlgorithmSolutions
#ArrayHandling
#CodingInPython
#TechInterviews
#PythonCoding
#ArrayFunctions
#MinMaxSearch
#ArrayChallenges
#AlgorithmProblems
#DataStructures
#PythonTips
#ArrayPuzzles
#CodingCommunity
#PythonLearning
#AlgorithmExplained
#ProgrammingInPython
#ArraySearch
#CodeSolutions
#PythonSnippets
#AlgorithmDesign
#ArrayProblems
#CodingJourney
#PythonTricks
#ArrayTips
#ProblemSolving
#PythonDevelopment
#ArrayManipulation
#CodingHelp
#PythonArrays
#AlgorithmicThinking
#ArrayInterview
#CodingSkills
#PythonCodingTips
#ArrayLogic
#AlgorithmAnalysis
#CodeLearning
#PythonAlgorithm
#ArrayExplained
#ProgrammingTips
#PythonSolutions
#ArrayTricks
int[] array = {9, 80, 7, 5, 6};
Arrays.sort(array);
System.out.println("Max is: "+array[array.length-1]+'\t'+"Min is: "+ array[0]);
Thank you
This playlist is the most sensible playlist on java interview programs on entire TH-cam. Thanks
Arrays.sort(a); //sorts in ascending order
Sysout(a[a.length-1]); -> max value
Sysout(a[0]); -> minimum value
but it will take: Time complexity:- O(nlog n)
Space complexity:- O(1)
how can we do it with minimum camparison.
sir i am very grateful to you , you take my hole fear into the air😀 previously i don't know anything logic behind programming now i give interviews very confidently ❤ just one thing please make some experienced level interview programming question also THANK YOU Again from Uttar Pradesh....
You explained this so well, and I am very thankful that you went step by step and explained more than once if you deemed necessary. Many teachers do not do this, and again, I am grateful that you do.
Thank u sir i didn't understand how this was possible but when you understood me then I got everything.....
You are most welcome
Here we can combine both if loop inside for loop so that with same "for" iteration we can get max and min
It is very very helpfull for beginners by your efforts somewhere someone is learning programming very effectively... thank you so much sir...
You are most welcome
Explained in a very simple way. Thanks, sir
Thank you so much for your feedback. Please share my videos with your friends or colleagues.
Thanku continue making videos on java plz
Thanku You so much sir your best for increasing my programing logic.. and the playlist is very good thankyou from maharashtra..
Welcome
Explained in simple way..thank you so much...sir please upload more videos on string related java programs...
Sure I will
Thank you Sir 🙏you explained logic very easily, I understood ❤. Keep doing Sir 🙏
Welcome
It will not work when 3 and 6 both are missing. can you please add the solution as well
for i=1 , a[i]>max =30>50 -> if condition is false so it continues the loop , until if condition becomes true then , sets the max to that value
sir pls make a video in jaba 1St max,2nd max and 3rd max element from arrays
Thank you sir
Welcome
Wonderful job sir!!!
thanks
Fabulous teaching sir pls some more playlist on logics and dsa
Thanks
Thank you sir!
Welcome
You r doing great work
Thanks
There is a 2 liner solution...
List lst = Arrays.asList(myArrayOfNumbers);
int max = Collections.max(lst);
int min = Collections.min(lst);
Here idea was to develop logic by not using any pre defined methods
Amazing 🎉
Thanks
Useful Thanku
Welcome
Commenting for better reach
very helpful video sir
Thanks
Here for both min and Max time complexity is n^2. So is there any other solution where we can reduce time complexity?
int[] array = {9, 80, 7, 5, 6};
Arrays.sort(array);
System.out.println("Max is: "+array[array.length-1]+'\t'+"Min is: "+ array[0]);
Very helpful sir
Glad to hear that
Thank u sir🙏
Most welcome
Thank you so much 💗
You're so welcome!
thank you
You're welcome
great video
Thanks
well explained
Thanks
sir kindly update this list
Sir please add frequently asked python programs
Coming soon.
but this is so expensive and can be done much more efficiently
salute
My pleasure
🇮🇳🇮🇳🙏🙏👍👍
package javaapplication23;
import java.util.ArrayList;
import java.util.Scanner;
public class JavaApplication23 {
public static void main(String[] args) {
int[] a = {1,2,3};
int[] b = {1,2,3,4};
System.out.println(Math.max(0, a.length));
System.out.println(Math.max(0, b.length));
}
}
This code will only work if you don't have to input array elements into scanner an all your numbers are presumed to be over 0
This playlist is the most sensible playlist on java interview programs on entire TH-cam. Thanks
Commenting for better reach