put all the players in a stack
now pop two players from stack
insert the winning player in to a circular doubly linked list.
now repeat the procedure and while inserting in doubly linked list if the
linked list is not null then start from tail and compare the popped node
with it that whether it won, if it won then make it the tail if not then
move inwards ... i.e insert it before the node it won against.

On Sat, Jul 31, 2010 at 3:45 PM, Ram Kumar <harrypotter....@gmail.com>wrote:

> Consider there are N players who have a round robin tournament.
> input is a data structure which says who won the match for every pair <i ,
> j> i != j .
> write an algo to give a sequence A[1...n] such that for ever i , i th
> player lost to i+1 th player and won against i-1 th player.
>
> --
> Regards,
> Ramkumar.G
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
With Regards,
Jalaj Jaiswal
+919026283397
B.TECH IT
IIIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to