Answered step by step
Verified Expert Solution
Link Copied!

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 3(7=7) 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago