- Data Structures & Algorithms
- DSA - Home
- DSA - Overview
- DSA - Environment Setup

- Algorithm
- DSA - Algorithms Basics
- DSA - Asymptotic Analysis
- DSA - Greedy Algorithms
- DSA - Divide and Conquer
- DSA - Dynamic Programming

- Data Structures
- DSA - Data Structure Basics
- DSA - Array Data Structure

- Stack & Queue
- DSA - Stack
- DSA - Expression Parsing
- DSA - Queue

- Searching Techniques
- DSA - Linear Search
- DSA - Binary Search
- DSA - Interpolation Search
- DSA - Hash Table

- Sorting Techniques
- DSA - Sorting Algorithms
- DSA - Bubble Sort
- DSA - Insertion Sort
- DSA - Selection Sort
- DSA - Merge Sort
- DSA - Shell Sort
- DSA - Quick Sort

- Graph Data Structure
- DSA - Graph Data Structure
- DSA - Depth First Traversal
- DSA - Breadth First Traversal

- Tree Data Structure
- DSA - Tree Data Structure
- DSA - Tree Traversal
- DSA - Binary Search Tree
- DSA - AVL Tree
- DSA - Spanning Tree
- DSA - Heap

- DSA Useful Resources
- DSA - Questions and Answers
- DSA - Quick Guide
- DSA - Useful Resources
- DSA - Discussion

# Tournament Trees, Winner Trees and Loser Trees in Data Structure

Here we will see the Tournament trees, Winner and Looser trees. The Tournament tree is a complete binary tree with n external nodes and n – 1 internal nodes. The external nodes represent the players, and the internal nodes are representing the winner of the match between the two players. This tree is also known as Selection tree.

There are some properties of Tournament trees. These are like below −

This tree is rooted. So the link in the tree and directed path from parent to children, and there is a unique element with no parents

The parent value is less or equal to that node to general any comparison operators, can be used as long as the relative value of the parent and children are invariant throughout the tree

Trees with a number of nodes not a power of 2, contain holes. Holes can be present at any place in the tree.

This tree is a proper generalization of binary heaps

The root will represent overall winner of the tournament.

There are two types of Tournament Trees −

Winner Tree

Looser Tree

## Winner Tree

Winner tree is a complete binary tree, in which each node is representing the smaller or greater of its two children, is called winner tree. The root is holding the smallest or greatest node of the tree. The winner of the tournament tree is the smallest or greatest n key in all the sequences. It is easy to see that winner tree can be formed in O(log n) time.

**Example** − Suppose there are some keys, 3, 5, 6, 7, 20, 8, 2, 9

## Looser Tree

Looser Trees are complete binary tree for n players where n external nodes and n – 1 internal nodes are present. The looser of the match is stored in the internal nodes. But in this overall winner is stored at tree[0]. The looser is an alternative representation, that stores the looser of a match at the corresponding node. An advantage of the looser is that, to restructure the tree after winner tree been output, it is sufficient to examine node on the path from leaf to root rather than the sibling of the nodes on this path.

**Example** − To form a looser tree, we have to create winner tree at first.

Suppose there are some keys, 10, 2, 7, 6, 5, 9, 12, 1. So we will create minimum winner tree at first.

Now, we will store looser of the match in each internal node.

- Related Articles
- Huffman Trees in Data Structure
- Splay trees in Data Structure
- Solid Trees in Data Structure
- Range Trees in Data Structure
- BSP Trees in Data Structure
- R-trees in Data Structure
- Interval Trees in Data Structure
- Segment Trees in Data Structure
- Optimal Lopsided Trees in Data Structure
- Threaded Binary Trees in Data Structure
- Red-Black Trees in Data Structure
- Comparison of Search Trees in Data Structure
- Dynamic Finger Search Trees in Data Structure
- Level Linked (2,4)-Trees in Data Structure
- Randomized Finger Search Trees in Data Structure