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
ANTONII [103]
3 years ago
5

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

by one, 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.
Computers and Technology
1 answer:
Lilit [14]3 years ago
4 0

The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.

#include<stdio.h>

#include<string.h>

 int* uniqueValue(int input1,int input2[])

 {

   int left, current;

   static int arr[4] = {0};

   int i      = 0;

     for(i=0;i<input1;i++)

      {

         current = input2[i];

         left    = 0;

         if(current > 0)

         left    = arr[(current-1)];

      if(left == 0 && arr[current] == 0)

       {

       arr[current] = input1-current;

       }

       else

   {

       for(int j=(i+1);j<input1;j++)

       {

           if(arr[j] == 0)

           {

               left = arr[(j-1)];

               arr[j] = left - 1;

           }

       }

   }

}

return arr;

}

You might be interested in
Insurance can help you:a. minimize monthly expenses
KIM [24]
This is an easy answer sure in the back of your mind u knew it was b good luck :).

4 0
3 years ago
The number of colors in a bitmap image determines which category the image will be in. Complete the following sentences.
Jobisdone [24]

Answer:

Explanation:

1.Grayscale

2.Multitone

7 0
3 years ago
Once you turn 18, if you choose one of the 4 options for accessing credit, how will you be sure you use that credit responsibly?
dmitriy555 [2]

Answer:

hm not sure man

Explanation:

sorry, give me crown and 5 stars  tho

6 0
2 years ago
2560x1600 (apple)vs 1920x1200 (Dell), is there a big difference between those 2 based on screen resolution ? ​
Solnce55 [7]

Answer:

Yes

Explanation:

1920x1200 is a non-standard resolution which may not be fully supported, usually 1920x1080 (1080p) is preferred and has been standardised as a display resolution.

2560x1600 (WQXGA) is a more standardised display resolution, and will offer a lot sharper and crisper images as more pixels are being used to render the image. As a rule of thumb, the higher resolution - the better.

The difference between these two resolutions is about the same difference as 1080p and 2k, you are going to get twice as crisp an image.

However there are other factors, such as refresh rate that may come into play with a comparison with these two.

3 0
3 years ago
This is computer and programming
miv72 [106K]

Answer:yes

Explanation:because

3 0
3 years ago
Read 2 more answers
Other questions:
  • What is a function library?
    11·1 answer
  • 5. Which of the following is a Windows feature that allows you to temporarily store text?
    13·2 answers
  • For each of these statements find a domain for which the statement is true and a domain for which the statement is false. a) Eve
    13·1 answer
  • Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1 = 500 kbps, R2
    14·1 answer
  • PrimeFactorization.java: Write a program that begins by reading in a series of positive integers on a single line of input and t
    12·1 answer
  • Q13. On which option do you click to
    12·1 answer
  • Explain how to utilize the computer in rooms management.​
    13·1 answer
  • Pls help! for computers edge 2021
    7·1 answer
  • What are the syntax of c programming language?
    9·1 answer
  • What is the descriptor for a filter that warns or blocks you from potentially fraudulent or suspicious websites?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!