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, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Think of a spreadsheet as a giant calculator spread of paper chart data collector
Answers: 2
question
Computers and Technology, 24.06.2019 20:30
Drums installed, you would apply clicks of the parking brake to obtain a slight drag on both rear wheels
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
Mathematics, 23.04.2020 03:16
Questions on the website: 13722359