Re: need help on divide and conquer algo
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 22:39:21 +0000 (UTC)
urvi said:
> below is the task for me to solve.. can anybody help me?
I can help you with the general case. I don't quite see how a power of 2
leads to any significant improvement. Perhaps others here will enlighten us
both.
>
> You are to organize a tournament involving n teams. Each team must play
> each possible opponent exactly once. Moreover, each team must play
> exactly one game per day.
We note, then, that n must be even (otherwise, the constraint makes the
assignment impossible).
Let the syntax
ABCDE
FGHIJ
mean that A plays F, B plays G, C plays H, etc.
Let's take an example with, say, n = 12.
ABCDEF
GHIJKL
gives you the first round. To get the second round, make a hole by removing
G:
ABCDEF
HIJKL
Move A down into the hole, leaving its previous space as a hole instead:
BCDEF
AHIJKL
Slide the top row across:
BCDEF
AHIJKL
leaving the hole at the end of the top row. Lift L into that hole:
BCDEFL
AHIJK
Slide the bottom row across:
BCDEFL
AHIJK
Replace G:
BCDEFL
GAHIJK
This gives you the next round. Iterate. After 11 goes, you're back where you
started.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/2005
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.
- References:
- need help on divide and conquer algo
- From: urvi
- need help on divide and conquer algo
- Prev by Date: need help on divide and conquer algo
- Next by Date: Re: need help on divide and conquer algo
- Previous by thread: need help on divide and conquer algo
- Next by thread: Re: need help on divide and conquer algo
- Index(es):
Relevant Pages
|