Docsity

Tournament Trees - Algorithms and Applications in Java - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Tournament Trees - Algorithms and Applications in Java - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Tournament Trees

Winner trees.

Loser Trees.

Docsity.com

Winner Trees

Complete binary tree with n external

nodes and n - 1 internal nodes.

External nodes represent tournament

players.

Each internal node represents a match

played between its two children;

the winner of the match is stored at

the internal node.

Root has overall winner.

Docsity.com

Winner Tree For 16 Players

Smaller element wins => min winner tree.

Docsity.com

Winner Tree For 16 Players

height is log

n (excludes player level)

Docsity.com

Applications

Sorting.

Put elements to be sorted into a winner

tree.

Repeatedly extract the winner and

replace by a large value.

Docsity.com

Sort 16 Numbers

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com

Sort 16 Numbers

Sorted array.

Docsity.com