Tournament bracket method to put distance between teammates

Posted by Fred Thomsen on Programmers See other posts from Programmers or by Fred Thomsen
Published on 2014-06-05T03:40:28Z Indexed on 2014/06/05 15:37 UTC
Read the original article Hit count: 241

I am using a proper binary tree to simulate a tournament bracket. It's preferred any competitors in the bracket that are teammates don't meet each other until the later rounds. What is an efficient method in which I can ensure that teammates in the bracket have as much distance as possible from each other? Are there any other data structures besides a tree that would be better for this purpose?

EDIT: There can be more than 2 teams represented in a bracket.

© Programmers or respective owner

Related posts about algorithms

Related posts about data-structures