Tournament Tree or Winner Tree

Tournament Tree or Winner Tree : 
Is a form of min(max) heap which is a complete binary tree.
every external node represents a player and internal node represents a winner.

Winner: select the best player among N palyers , (N -1) players to be eliminated. we need minimum of (N-1) games (comparisons).

Second best player:
we can pick second best player in (N + log2(n-2)) comparisons.


 The above tree contains 4 leaf nodes that represent players and have 3 levels 0, 1 and 2. Initially 2 games are conducted at level 2, one between 5 and 3 and another one between 7 and 8. In the next move, one more game is conducted between 5 and 8 to conclude the final winner. Overall we need 3 comparisons. For second best player we need to trace the candidates participated with final winner, that leads to 7 as second best.

Uses:
Tree selection sort using tournament tree.

 


Comments

Popular posts from this blog

Linked List

Heaps