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
I accidentally pressed the challenge button while I was scrolling through. I didn't mean to press that challenge, instead of the
kondor19780726 [428]

Answer:

Can u pls answer my questions I’m so stuck and I need them by tmrw or today pls I don’t know how to get ahold of u

Explanation:

5 0
4 years ago
Read 2 more answers
Alex leads a team of eight members. Arrange his tasks in sequential order of phases of group dynamics. What are the stages in gr
Alborosie

Answer and Explanation

There are five stages of group development which Alex should follow.

i) Stage 1: Forming-this is where he forms a team which will follow the other stages.

ii)Stage 2: Storming - In this stage is where the members set their goals and boundaries.

iii)Stage 3: Norming- This is where the team comes together in terms of ideas. In this stage members are ready to move forward with big expectations.

iv)Stage 4: Performing.-This is where  now the team is now accomplishing or implements their ideas and they are now getting the benefits.In this stage members argue positively.

v)Stage 5: Adjourning-This is the stage where the group has accomplished their mission.And now the group is dissolved

7 0
3 years ago
Ethical design refers to...
Travka [436]

Answer:

C. A set of principles dictating that technology should do no harm and seek to improve the human condition

Explanation:

Anything "ethical" refers to being "right" or "just", for example, calling someone a racial slur would not be ethical, but learning a little bit about their culture to understand them better would be ethical

8 0
3 years ago
Is Brainly cheating??
Vanyuwa [196]

Answer: What do you mean?

6 0
3 years ago
Read 2 more answers
Trent is a skilled sketch artist who wants to create images for his online portfolio. He is even
Sidana [21]

Answer: A digital tablet

Explanation: a scanner wouldnt show how to draw, a stock image would just show an image, phtot editing is to edit a picture took like to change the light. The answer is Digital tablet because you can draw on it while recording.

8 0
3 years ago
Other questions:
  • What setting must be enabled to view data in Demographics and Interests Reports? Content Grouping Advertising features User perm
    13·1 answer
  • 1.What is a project methodology?
    9·1 answer
  • The background image does not affect any cell’s format or content. _______
    5·1 answer
  • Multiply 2.7×10^4 by 6.3×10^6​
    13·2 answers
  • Which formula is a complex formula?<br> =D6/E10<br> =10-(A3-D13)<br> =C3+10+E3<br> =5+A1*B1
    12·2 answers
  • An example of a ______ in the United States are computer hackers, whose members engage in actions that subvert authority, disrup
    6·1 answer
  • Explain with examples: <br> What are the reasons of a successful and unsuccessful software project?
    14·1 answer
  • What can a user do using the Contact Group dialog box? Check all that apply.
    10·2 answers
  • What Microsoft feature enables you to represent text as colorful visuals
    12·1 answer
  • The U.S. consumes lots of energy. Which fuel provides the most energy?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!