Menu

(Solved) : Group N Runners Finished Close Race Unfortunately Officials Finish Line Unable Note Order Q37175536 . . .

A group of n runners finished a close race. Unfortunately, theofficials at the finish line were unable to note down the order inwhich the racers finished. Each runner, however, noted the jerseynumber of the runner finishing immediately ahead of her or him.(There were no ties.) The race officials ask each runner to give anordered pair, containing two pieces of information: (i) first, hisor her own jersey number and (ii) second, the jersey number of therunner who finished immediately ahead of him or her. The winner ofthe race, who did not see anybody finish ahead of her, did not turnany information in.

Design an algorithm that takes as input the n-1 pairs andreturns the order in which the runners finished the race. Assumeeach runner is honest.

Prove the correctness of your algorithm and analyze itsworst-case time complexity.

Expert Answer


Answer to A group of n runners finished a close race. Unfortunately, the officials at the finish line were unable to note down the…

OR