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 08:30
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Janice usually works on a particular workbook that contains all business related data. she decides to keep a backup of all the data in a separate workbook. she opens a new workbook to transfer the data. which option should she use to copy all the data from one workbook to another workbook?
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
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
English, 20.04.2021 14:00
question
Mathematics, 20.04.2021 14:00
question
Computers and Technology, 20.04.2021 14:00
question
Medicine, 20.04.2021 14:00
question
Physics, 20.04.2021 14:00
question
Biology, 20.04.2021 14:00
question
Mathematics, 20.04.2021 14:00
question
Geography, 20.04.2021 14:00
question
Social Studies, 20.04.2021 14:00
Questions on the website: 13722359