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
What is the internal working of the computer called?
charle [14.2K]

Answer:

It should be the Central processing unit, as it is the part where information is calculated in the compute, but RAM is also an internal working, used for temporarily storing information. I would Go with CPU to be safe.

6 0
3 years ago
Imagine you had a learning problem with an instance space of points on the plane and a target function that you knew took the fo
gavmur [86]

Answer:

The answer is nearest-neighbor learning.

because nearest neighbor learning is classification algorithm.

It is used to identify the sample points that are separated into different classes and to predict that the new sample point belongs to which class.

it classify the new sample point based on the distance.

for example if there are two sample points say square and circle and we assume some center point initially for square and circle and all the other points are added to the either square or circle cluster based on the distance between sample point and center point.

while the goal of decision tree is to predict the value of the target variable by learning some rules that are inferred from the features.

In decision tree training data set is given and we need to predict output of the target variable.

Explanation:

5 0
4 years ago
We have noted that there can be no input queuing if the switching fabric is n times faster than the input line rates, assuming n
Ostrovityanka [42]

Consider the given data:

Assume packet length=n

Maximum queuing delay= (n–1)D

All packets are of the same length, n packets arrive at the same time to the n input ports, and all n packets want to be forwarded to different output ports.

a)  The maximum delay for a packet for the memory = (n-1)D

b)  The maximum delay for a packet for the bus = (n-1)D

c)  The maximum delay for a packet for the crossbar switching fabrics=  0

7 0
3 years ago
The safest action to take if someone claiming to be from your bank calls you to ask for account information is to
Fofino [41]
Hang up, and inform your (real) bank that someone may attempt to steal your identity and your money.
6 0
3 years ago
Read 2 more answers
What types of data can you filter using the
Butoxors [25]

Answer: A and B

Explanation: just did it on edge

4 0
3 years ago
Other questions:
  • What is a drawback to being in Slide Show mode? a- Being able to review each slide in order
    8·2 answers
  • What is the process of comparing data with a set of rules or values to find out if the data is correct?
    8·2 answers
  • Stuart wants to delete some text from a slide. What should Stuart do?A. From the Review tab, choose Highlight text and then pres
    7·2 answers
  • An organization's IRP prioritizes containment over eradication. An incident has been discovered where an attacker outside of the
    14·1 answer
  • A network security analyst received an alert about a potential malware threat on a user’s computer. What can the analyst review
    12·1 answer
  • ________ is a remote access client/server protocol that provides authentication and authorization capabilities to users who are
    10·1 answer
  • What is the result when you run the following line of code after a prompt??
    5·1 answer
  • Who Has any idea How to code?
    7·2 answers
  • Click here for a answer
    15·1 answer
  • Select the correct answer. Which step references adding color, size, and media format in your digital portfolio? A. identifying
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!