Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 ( 7 = 7 ) Reconstructing a total order A group of n runners finished a close race. Unfortunately, the officials at the
Problem Reconstructing a total order
A group of n runners finished a close race. Unfortunately, the officials at the finish line were unable to note
down the order in which the racers finished. Each runner, however, noted the jersey number of the runner
finishing immediately ahead of her or him. There were no ties. The race officials ask each runner to give
an ordered pair, containing two pieces of information: a first, his or her own jersey number and b second,
the jersey number of the runner who finished immediately ahead of him or her. The winner of the race, who
did not see anybody finish ahead of her, enters for b
You have been asked to design an algorithm that takes as input the n pairs and returns the order in which
the runners finished the race. Assume each runner is honest.
Give a deterministic Theta n log n time algorithm, and justify the running time of the algorithm. Hint: Use
sorting.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started