Newest Viewed Downloaded

Complexity Of ReplayOne match at each level that has a match node. O(log n) More precisely (log n).

Tournament Trees Winner trees. Loser Trees.

Tennis ladder.

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.

Winner Tree For 16 Players

player match node See text for case when number of players is not a power of 2.

Winner Tree For 16 Players

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 Smaller element wins => min winner tree. 3 6 1 3 2 4 2 5 3 1 2 2 1 2 1

Winner Tree For 16 Players

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 height is log2 n (excludes player level) 3 6 1 3 2 4 2 5 3 1 2 2 1 2 1

Complexity Of Initialize

O(1) time to play match at each match node. n - 1 match nodes. O(n) time to initialize n player winner tree.

Representation

A winner tree of n players requires n-1 internal nodes t[1:n-1] The players(or external nodes) are represented as an array e[1:n] t[i] is an index into the array e, t[i] gives the winner of the match played at node i of the winner tree

Applications Sorting. Put elements to be sorted into a winner tree. Repeatedly extract the winner and replace by a large value (eg. +).

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 1 3 2 4 2 5 3 1 2 2 1 2 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 1 3 2 4 2 5 3 1 2 2 1 2 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 1 3 2 4 2 5 3 1 2 2 1 2 1 Sorted array. 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 5 3 2 4 2 5 3 1 2 2 1 2 1 Sorted array. 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 2 4 2 5 3 2 2 1 2 1 Sorted array. 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 2 4 2 5 3 2 2 3 2 1 Sorted array. 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 2 4 2 5 3 2 2 3 2 2 Sorted array. 1

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 2 4 2 5 3 2 2 3 2 2 2 2 Sorted array. 1 2

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 6 4 2 5 3 2 2 3 2 2 2 2 Sorted array. 1 2

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 6 4 2 5 3 4 2 3 2 2 2 2 Sorted array. 1 2

Sort 16 Numbers

4 3 6 8 1 5 7 3 2 6 9 4 5 2 5 8 3 6 3 5 3 6 4 2 5 3 4 2 3 2 2 2 2 Sorted array. 1 2

Showing 1 - 20 of 65 items Details

Name: 
chap10
Author: 
Preferred Customer
Company: 
N/A
Description: 
Complexity Of ReplayOne match at each level that has a match node. O(log n) More precisely (log n).
Tags: 
winner | tree | bin | sort | sorted | fit | the | array
Created: 
6/17/1995 11:31:02 PM
Slides: 
65
Views: 
1
Downloads: 
0
Rating: 
0


> Comment



Share this presentation
|

Comments

Share this presentation:

|
Sitemap