How do you find the largest and smallest number in an unsorted integer array Python?

Answers

Answer 1

There are 3 methods to find the largest and smallest number in an

unsorted integer array Python.

How do you find the largest and smallest number in an unsorted integer array Python?Method 1 : Using Iteration.Method 2 : Using Sort() function.Method 3 : Using max() and min() function

Method 1:

Take a variable say mini to store the smallest element of the array and maxi to store the largest element.Set mini = arr[0] and maxi = arr[0]Check if(arr[i]<mini) then set mini = arr[i]Also check if(arr[i]>maxi) then set maxi = arr[i]After complete iteration print mini and maxi.

Method 2:

Sort the array using inbuilt sort()functionSmallest element is at index 0 and largest is at index -1So, print(arr[0])And, print(arr[-1])

Method 3:

Using inbuilt function min(arr) , it return smallest element of the array.Similarly max(arr) return the largest element of the array.

There are 3 methods to find the largest and smallest number in an

unsorted integer array Python.

To know more about unsorted integer array, check out:

https://brainly.com/question/14451504

#SPJ4


Related Questions

Find area of square
Pls help

Answers

Step-by-step explanation:

Area of square

[tex] {s}^{2} [/tex]

[tex]6.7 \times 6.7 = 44.89 {mm}^{2} [/tex]

Tuesday Evaluate the Expression: Use PEMDAS. 80 - 42+8​

Answers

Answer:

30

Step-by-step explanation:

Using BODMAS

*80-50 (42+8)

*30

Val walked dogs to save money for some books she wanted to buy. To determine how much money she will make, she used the function rule y = 6x. Find f(x) = 7.

Answers

Answer:

y=6x

y=6(7)

y=6 times 7

y=42

Answer:

42

Step-by-step explanation:

if Y=6, and fx=7, then multiply 6 and 7

Sarah uses 2 eggs for each batch
of 12 muffins that she bakes. How
many muffins can she bake with a full
carton of 12 eggs?

Answers

Answer:

I think it would be 72

Step-by-step explanation:

You would have to divided 2 by 12, which is 6. Then, you would have to multiply 6 by 12, which i s 72. I hope this is right, if not I'm sorry. I really hoped this helped :D

PLZ ANSWER QUICK WHAT IS THE RANGE OF THESE NUMBERS! WILL GIVE BRAINIEST

(give a correct number of the range of the numbers)

Answers

Answer:

170

Step-by-step explanation:

Somebody help pls I need help with this

Answers

Answer:

Step-by-step explanation:140

70 Miles

Explanation:
If 1 inch equals 7 miles than simply multiply 7 x 10 and that equals 70.
Hope this helps!

What happens when the ordered pair (x,y) moves to the right?

Answers

Question is unclear

Expand and Simplify: (2x-1)(3x-2)

Answers

Answer:

6x^2-7x+2

Step-by-step explanation:

Given data

We have the expression

(2x-1)(3x-2)

First let us open the bracket

2x(3x-2)-1(3x-2)

6x^2-4x-3x+2

Collect like terms

6x^2-7x+2

Can you help me with my work

Answers

Answer:

all u have to do is count how many 2 there are then put that in and do the same for the 8

Step-by-step explanation:

Answer:

[tex]2^{6} *8^{4}[/tex]

Step-by-step explanation:

Help me question 3 plzzz

Answers

Answer:

it should be the top answer

Step-by-step explanation:

it's asking for a fraction with 3 as a denominator that is greater than one. if you need a better explanation feel free to ask in a comment!

Answer:

2+x

--------- >1

3

Step-by-step explanation:

......ur welcome.......

Which one A, B, C, D ??

Answers

Answer:

A proportion describes the share of one value for a variable in relation to a whole. It is calculated by dividing the number of times a particular value for a variable has been observed, by the total number of values in the population.

So it is B! Mark me brainliest plzz!

Step-by-step explanation:

Answer:

the correct answer would be A

Step-by-step explanation:

brainlest pls

At middle school lunch in the cafeteria, 60% of the students pack a lunch and 40% buy a lunch. Of the students who pack a lunch, 70% have a cookie. What is the percent of the students who have a cookie at lunch?

Answers

Answer:

42%

Step-by-step explanation:

The computation of the percentage is shown below:

Here we assume that there are 100 students

So according to the question

60% of the students would pack the lunch i.e. 60 students

And, 40% of the students buy a lunch i.e. 40 students

Now the students who pack the lunch they have 70% of cookie

So, 70% of 60 students = 42 students

Now the percentage is

= 42 students ÷ 100 students

= 42%

-12 > -15
True or False?

Answers

Answer:

t

Step-by-step explanation:

-12 is closer to zero than -15

Answer: True, -12 is closer to 0 than -15. When it comes to negative numbers the number closest to 0 is always the biggest.

PLS HELP!!!!!
which polynomial is a perfect square trinomial?

A. 49x^2 - 28x + 16
B. 4a^2 - 20a + 25
C. 25b^2 - 20b - 16
D. 16x^2 - 24x - 9

Answers

Answer:

B

Step-by-step explanation:

We have to find which trinomial has:

1) two terms that are the perfect square of two numbers

2) a terms that is the double product of the two numbers

the first condition is satisfied by A and B, but only B satisfied the second., in fact the trinomial can be rewrite as: (2a-5)^2

Options C and D are traps because the square of a number can’t be negative

What is the volume of this solid figure made with cubes

Answers

Answer:

15

Step-by-step explanation:

three times five = fifteen and height is 1

Answer:

15

Step-by-step explanation:

multiply the length x width x height

What is the equation of the line shown in the graph?

Answers

Answer:

-6

Step-by-step explanation:

I'm not really sure whether or not your question is asking for the slope intercept form or just the slope.

Your answer would be: y = -6x + 7   [if your question is asking for the slope intercept form]

OR

Your answer would be: -6   [if your question is asking for just the slope]

Andrew is downloading photos from his camera’s memory cards. He downloaded 2,145 megabytes (MB) from a total of 250 normal-quality photos and 100 best-quality photos from his smaller memory card. From the larger memory card, he downloaded 6,330 MB from a total of 500 normal-quality photos and 400 best-quality photos. The graph shows a system of equations representing the two downloads. How many MB is a photo of normal quality and how many MB is a photo of best quality?

Answers

Answer:

it is c

Step-by-step explanation:

lkhbkgbigligi;g;og

If the area of a rectangle can be represented by x^2 -5x-14. What two expressions can represent the dimensions of the rectangle?

Answers

Answer:

x-7

x + 2

Step-by-step explanation:

the equation is a quadratic equation

we need to find factors of -14x² that would add up to -5x

these factors are -7x + 2x

(x² + 2x) - (7x - 14)

factorise the expressions in the bracket

x(x + 2) -7(x + 2)

(x-7 )

or x + 2

Which is the most accurate way to estimate 66% of 46?

A: 2/3 x 47
B: 1/3 x 45
C: 1/3 x 47
D: 2/3 x 45

Answers

Answer:

30 Don't use your calculator.

Step-by-step explanation:

This is an estimation question, so you have to throw your calculator out of your reach.

You have to know that 66% is nearly 2/3 So the correct answer cannot be B or C

It must be A or D.

The problem is that 3 doesn't go into 46 so you have to change it to something that is divisible by 3. Of the numbers given, the best one is 45

2/3 * 45 = 2 * 15 = 30

How close is that (remember you have to give 30 as your answer)?

The actual answer is 30.36 which makes your estimate very good.

Alicia will construct a rectangle that has a height of 4 units and an area of up to 48 square units. Which inequality represents all the possible lengths in units of the bases, b, that Alicia can use to construct this rectangle?

Answers

Answer:

b ≤ 12

Step-by-step explanation:

The area of the rectangle is given by length multiplied by breadth.

The area of the rectangle up to 48 units square means that it can be 48 or less than 48.

If the height given is taken as the width of the rectangle then we can find the base which will be the length of the rectangle.

Area = length * breadth

4units * base ≤ 48 units square

base ≤ 48 units square/4 units

base ≤ 12 units

b ≤ 12 units

What is the scale factor of the dilation?

Answers

Answer:

Step-by-step explanation:

2/5

Nick needs to raise at least $320 for his trip. He has $80 saved already, and he makes $40 per yard that he mows. Write and solve an inequality to solve for how many yards, "x," Nick must mow to earn the money.

Answers

Answer: Nick must now at least 6 yards.

Step-by-step explanation:

Since Nick has $80 saved already, and he makes $40 per yard that he mows, thus can be put up in an equation as:

= 80 + 40y

where y = number of yards

Since Nick needs to raise at least $320 for his trip, the equation to solve this will be:

80 + 40x ≥ 320

40x ≥ 320 - 80

40x ≥ 240

x ≥ 240/40

x ≥ 6

Therefore, Nick must now at least 6 yards.

Evaluate the expression: 5 + 3 × (5 - 2)²

Answers

Answer: 32

Step-by-step explanation:

5+3*(5-2)^2

5+3*(3)^2

5+3*9

5+27

32

Answer:

32

Step-by-step explanation:

5 + 3 * (5 - 2)^2

5 + 3 * 3^2

5 + 3 * 9

5 + 2

= 32

What’s the volume will give brainliest

Answers

I dont know but thanks for your points

Answer:

2,860cm³

Step-by-step explanation:

just multiply all of the numbers.

Which of the following leading terms would make the expression a perfect square trinomial?
____ −140xy+100y2

A) 49x^2
B) 25x^2
C) 81x^2
D) 64x^2

Answers

A) 49x^2

Because:
(7x-10y)^2 = 49x^2 - 140xy + 100y^2

Anyone know how to answer this question

Answers

Answer:

x²+y²=225

Step-by-step explanation:

when centered at the origin the equation of a circle is x²+y²=r²

we are given x and y so 9²+12²=r²

[tex]r^{2} =9^{2} +12^{2}\\ =81+144\\ =225[/tex]

12. Solve for x. x = ___________

Answers

Step-by-step explanation:

this is math right what grade is this

In the diagram ABC is congruent to DEF. aging the values of x and y

Answers

Answer:

x = 1, y = 46

Step-by-step explanation:

Since the triangles are congruent then corresponding sides and angles are congruent, then

DE = AB , that is

3x + 6 = 9 ( subtract 6 from both sides )

3x = 3 ( divide both sides by 3 )

x = 1

and

∠ C = ∠ F

10x + y = 56 ( substitute x = 1 )

10(1) + y = 56

10 + y = 56 ( subtract 10 from both sides )

y = 46

help and make sure 100 %

Answers

Answer:

1. 63

2.

3. 117

4.

Step-by-step explanation:

gimme some time to do 2 and 4

The acceleration (in m/s/s) of a body is directly proportional to the force (in N for newton) acting on the body. If a certain body accelerates at 10 m/s/s when subjected to a force of 3 N, what will the acceleration be under a force of 8 N??

Answers

Answer:

26.667

Step-by-step explanation:

Force is directly proportional to mass and acceleration.

So Let's first bring the parameters.

F=3N, A=10m/s M=?

F=ma:.

3=Mx10,. 3=10M

M=3/10 M= 0.3

So we will use that to find the acceleration of force 8N.

F=Ma:. 8=0.3xa

8=0.3a

A=8/0.3

A=26.667.

Other Questions
What is the median of the following 26 27 28 29 30? The Federal Helium Reserve held about 16 billioncubic feet of helium in 2010 and is being depleted byabout 2.1 billion cubic feet each year.a. Give a linear equation for the remaining federalhelium reserves, R, in terms of t, the number ofyears since 2010.b. In 2015, what will the helium reserves be?c. If the rate of depletion doesnt change, in what yearwill the Federal Helium Reserve be depleted How did the US Senate feel about the League of Nations? What are the 4 types of food service system? What happens to G3P in glycolysis? A system of equations consists of a line s of the equation y = x 5 and a line t that passes through the points (0, 2) and (8, 4). answer the questions about line t to write the equation. what is the slope of line t? what is the y-intercept of line t? what is the equation in slope-intercept form of line t? How does snowball show leadership in Animal Farm? Read the passage to answer the question. Even though scorpions are related to spiders, there are many differences between the two organisms. One difference is that scorpion young do not hatch from eggs as spiders do. Scorpions are born live, two at a time, and they immediately crawl onto the mother's back for protection and care. They remain there for two weeks as they grow big enough to take care of themselves. Question Scorpion cells undergo aerobic respiration, just as human cells do. Which substance is released during a scorpion's aerobic respiration? Responses oxygen oxygen ATP uppercase A T P carbon dioxide carbon dioxide nitrogen What is the slope intercept for 4x Y =- 5? harry is married and file joint tax return on which he uses the standard deduction if he make $1000charitable contribution in 2022 how much of contributionis deductible Why do the Spanish colonies believe that enslaving Africans is a necessity? Before robert buys a new car, which questions should he ask himself? check all that apply. which two processes must happen before cells can make large amounts of ATP for every glucose molecule split in two?A. glycolysis B. fermentation C. the krebs cycleD. the electron transport chain Match the term to its correct description.*music drama*singspiel*melodrama*leitmotif*light German comic opera with spoken dialogue*scenes with spoken dialogue or minimal singing, but striking orchestral accompaniment to intensify the dramatic effect of the words*leading motives in Wagnerian opera that represent emotions, characters, ideas, objects and continually transform*opera conceived by Wagner in which music, poetry, drama and visual spectacle are fused together the insertion of the teres minor is on the __________. Was the open door policy a foreign policy? What are the types of homeostasis? which of the following programs will result in filterednames only containing the names of students who are 17 or older?O B- for var i=0 i Which statement about Bismarck's antisocialist campaign is true?In 1877, the SDP won by huge number of votes, and Bismarck used all his powers against them.O He ordered assassinations of SDP leaders to stop them from becoming more powerful.O Bismarck supported more newspapers and pamphlets to promote anti-socialist thoughts and ideas.O He was totally opposed to a workers' movement and tried to curtail the minimum benefits enjoyed by workers in Germany. xi. Organs such as the ileum which absorb substances are often modified in ways which increase the rate of absorption. Which of the following would you not expect to increase the rate of absorption?A Coiled tube.B A slow blood flow.C Many finger like projections.D Many blood capillaries.