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
Select the focus questions that emphasizes what is more important: (Select all that apply) a.What needs to be relegated to the b
agasfer [191]

Answer:

Options b and d

Explanation:

Option B: What needs to be bigger and more prominent?

This gets the more foucs on the first look of the product to the user. Let's say you are developing a website and in the first page, your name and logo must be prominent and bigger than the rest of the elements on that webpage makes the user remember your name and the business model which gets more focus.

Option D: What needs to be brought into view in the foreground?

As the index says, face is the index of the mind, your product's index page is the face of your product. Hence it should be prioritized to show what is important and what is not.

The above two questions are the most important questions to be considered while emphasizing on what is more important.

5 0
3 years ago
Why do computers use binary code?
Anna71 [15]

Answer:

To make sense of complicated data, your computer has to encode it in binary. Binary is a base 2 number system. Base 2 means there are only two digits—1 and 0—which correspond to the on and off states your computer can understand

4 0
2 years ago
Read 2 more answers
Consider sending a 10000-byte datagram into a link that has an MTU of 4468 bytes. Suppose the original datagram is stamped with
AfilCa [17]

Answer:

Number of fragments is 3

Explanation:

The maximum size of data field in each fragment = 4468 - 20(IP Header)

= 4448 bytes

Hence, the number of required fragment = (10000 - 20)/4448

= 3

Fragment 1

Id = 218

offset = 0

total length = 4468 bytes

flag = 1

Fragment 2

Id = 218

offset = 556

total length = 4468 bytes

flag = 1

Fragment 3

Id = 218

offset = 1112

total length = 1144 bytes

flag = 0

5 0
2 years ago
How does the speaker feel about traditional forms of poetry
Salsk061 [2.6K]
A speaker sometimes is not able to capture the intended details since it is affected by homophones.
7 0
3 years ago
Read 2 more answers
What types of storage can be used to access your data on another computer?
Ivenika [448]
<span>You could use cloud storage. Basically, the things you save are actually saved on another computer, that is, on another server, that is used as a hard drive for many pcs. You can access the cloud storage if you have internet and it works like a normal hard drive. There are even laptops that don't have storage other than cloud storage.</span>
6 0
2 years ago
Other questions:
  • Which of the following would be a tradeoff of a scientific advancement that enables us to catch fish from the ocean faster than
    5·1 answer
  • 1. Why is it important to compare features of a computer before making a purchase?
    13·2 answers
  • How do you change the slide layout?
    6·2 answers
  • A collection of information stored in an electronic format that can be searched by a computer.
    14·1 answer
  • What features are provided by most GUIs?
    7·1 answer
  • Briefly summarize two examples of cybercrime stories.<br> quick pleaseeee
    10·1 answer
  • Write a program that inputs a time from the console. The time should be in the format "HH:MM AM" or "HH:MM PM". Hours may be one
    6·1 answer
  • An IP address in the form 197.169.100.1 is called a(n) ________. dotted quad encryption key random number sequential access numb
    7·1 answer
  • ساعدوني على الإجابة على هذه الأسئلة
    11·1 answer
  • 2. Write a Python regular expression to replace all white space with # in given string “Python is very simple programming langua
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!