If N is the number of teams, then tree depth would be log2(N). In case of 8 teams it's 3: quater-final, semi-final and final. Of course, for complete tree, the number of teams should be 2^N, where N is integer.

Solved

Posted on 2010-01-05

I am looking to write code to output elimination tournament brackets. I am at a step in the process where I am trying to figure out what teams should match up with each other to start the bracket (ie if 8 teams 1 plays 8, 4 plays 5, etc) and I think I've realised that to figure this out, I need to know how deep the tournament bracket goes (in the case of 8 teams it is 4 sections deep per below) I am trying to figure out the mathematics to determining this depth. I assume it must be similar to binary tree height, but I'm not sure how to do that?

I believe that in this problem statement the tree is complete, and I know the number of nodes and leaf nodes.

Tree example

1 -

| ---

8 - |

| ---

4 - | |

| --- |

5 - |

| ----

2 - |

| --- |

7 - | |

| ---

3 - |

| ---

6 -

I believe that in this problem statement the tree is complete, and I know the number of nodes and leaf nodes.

Tree example

1 -

| ---

8 - |

| ---

4 - | |

| --- |

5 - |

| ----

2 - |

| --- |

7 - | |

| ---

3 - |

| ---

6 -

3 Comments

By clicking you are agreeing to Experts Exchange's Terms of Use.

Title | # Comments | Views | Activity |
---|---|---|---|

Two list de-cypher | 6 | 81 | |

Independent Events | 4 | 43 | |

Two Dice Roll Probabilities | 3 | 32 | |

Triangles - computing angles | 7 | 22 |

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**8** Experts available now in Live!