1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
inna [77]
4 years ago
5

You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive by o

ne, sequentially (as their heights appear in A). For the i-th student, if there is a row in which all the students are taller than A[i], the student will stand in one of such rows. If there is no such row, the student will create a new row. Your task is to find the minimum number of rows created. test cases
Mathematics
1 answer:
Marrrta [24]4 years ago
6 0

The minimum number of rows is 1: if A is sorted in descending order, every next students will arrive in a row where everyone is taller than him, and no new rows will be created.

For example, consider

A = [190, 175, 170, 165, 150]

The first students creates the first row.

The second student is 175cm tall. In the first row everyone is taller than him (there's only the 190cm student), so he'll stand in this row.

The third student, 170cm, will find the row filled by the students who are 190 and 175cm tall. So, everyone is taller than him and he'll stand in that row as well.

You keep going with the other students, and you'll see that no one will form a new row.

You might be interested in
Which expression shows a way to find 25% of 1000?
grandymaker [24]

Answer:

25% of 1000 is 250

Step-by-step explanation:

(<u>25 ÷ 100</u>) × 1000

Divide the numbers

<u>0.25</u> × 1000

<u>0.25 × 1000</u>

Multiply the numbers

<u>250</u>

250

7 0
4 years ago
Read 2 more answers
A car travels 240kms in 3 hours. How fast will it travel in 5 hours?
sergejj [24]

\bf\large{please  \: refer  \: in  \: attachment}

5 0
3 years ago
How do I figure out what lines on number 10 are parallel
storchak [24]
Lines K and R, J and Q, L and S, and M and T are all parallel because at no point will they ever intersect.
7 0
3 years ago
(a) What is the probability that it won't rain tomorrow?
dem82 [27]

Answer:

10%

Step-by-step explanation:

10/100 = 10%

4 0
3 years ago
Read 2 more answers
Solve the quadratic equation 3x^2+2x-4=0
DENIUS [597]

Answer: x = 2/3, -2

Step-by-step explanation:

First factor the equation into (3x-2)(x+2)=0.  Thus, because one of the terms must be 0, x = 2/3, -2.

Hope it helps, and if you want help on how to factor quadratic expressions, just ask <3

7 0
4 years ago
Other questions:
  • Multiply these fractions (Lowest Terms)
    11·2 answers
  • Help me please.......
    9·1 answer
  • The cost, c, of a health club membership is related linearly to its length in months, m. If a 12-month membership costs $260 and
    15·1 answer
  • What is the value of X? Please help me with geometry.
    7·2 answers
  • I need help with 14, 15 and 16 plz ​
    7·1 answer
  • Find the number halfway between . 1/2. and . 5/6
    15·1 answer
  • Please help this is due in 5 minutes
    8·2 answers
  • Solve for x<br> A. 12<br> B. 11<br> C. 3<br> D. None of the above<br> E. 15
    12·1 answer
  • What is the value of this expression when a= -3 and b=5? a + b^2*
    15·1 answer
  • A CD usually sells for $17.00. If the CD is 20% off, and sales tax is 6%, what is the total price of the CD, including tax?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!