subject

There are n people standing in a line. The ith person p i , for 1 ≤ i ≤ n, has a height h i . All the people in our line have a unique height. We also know that the ith person has exactly f i number of people in front of them with height taller than h i (although is it not known which people, only the number). You are given as input a list of n pairs (h i ,f i ), for all 1 ≤ i ≤ n, but the list has been shuffled and is no longer in the correct order. Give an algorithm that reconstructs the original ordering of people. Your algorithm should run in O(nlogn) time.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:20
Number of megabytes of ram in a computer. qualitative or quantitative? because
Answers: 3
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
You know the right answer?
There are n people standing in a line. The ith person p i , for 1 ≤ i ≤ n, has a height h i . All th...
Questions
question
History, 21.09.2021 22:10
Questions on the website: 13722361