SNU IDB Lab. Ch.14 Tournament Trees © copyright 2006 SNU IDB Lab.

Slides:



Advertisements
Similar presentations
AVL Trees1 Part-F2 AVL Trees v z. AVL Trees2 AVL Tree Definition (§ 9.2) AVL trees are balanced. An AVL Tree is a binary search tree such that.
Advertisements

Tournament Trees CSE, POSTECH.
Winner trees. Loser Trees.
Selection Trees. What are selection trees? Complete binary tree Each node represents a “match” Winner Trees Loser Trees.
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
CMPT 225 Priority Queues and Heaps. Priority Queues Items in a priority queue have a priority The priority is usually numerical value Could be lowest.
1 Chapter 6 Priority Queues (Heaps) General ideas of priority queues (Insert & DeleteMin) Efficient implementation of priority queue Uses of priority queues.
CS 315 March 24 Goals: Heap (Chapter 6) priority queue definition of a heap Algorithms for Insert DeleteMin percolate-down Build-heap.
FALL 2004CENG 351 Data Management and File Structures1 External Sorting Reference: Chapter 8.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
Lec 6 Feb 17, 2011  Section 2.5 of text (review of heap)  Chapter 3.
TTIT33 Algorithms and Optimization – DALG Lecture 6 Jan Maluszynski - HT TTIT33- Algorithms and optimization Algorithms Lecture 5 Balanced Search.
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
Priority Queues. Container of elements where each element has an associated key A key is an attribute that can identify rank or weight of an element Examples.
A Binary Search Tree Implementation Chapter 25 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
CS Data Structures Chapter 5 Trees. Additional Binary Tree Operations (1/7)  Copying Binary Trees  we can modify the postorder traversal algorithm.
Heaps and heapsort COMP171 Fall 2005 Part 2. Sorting III / Slide 2 Heap: array implementation Is it a good idea to store arbitrary.
Priority Queues, Heaps & Leftist Trees
1 CSC 427: Data Structures and Algorithm Analysis Fall 2010 transform & conquer  transform-and-conquer approach  balanced search trees o AVL, 2-3 trees,
CSC 172 DATA STRUCTURES. Priority Queues Model Set with priorities associatedwith elements Priorities are comparable by a < operator Operations Insert.
1 HEAPS & PRIORITY QUEUES Array and Tree implementations.
CSCE 3110 Data Structures & Algorithm Analysis Binary Search Trees Reading: Chap. 4 (4.3) Weiss.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 7.
Tree. Basic characteristic Top node = root Left and right subtree Node 1 is a parent of node 2,5,6. –Node 2 is a parent of node.
ADT Table and Heap Ellen Walker CPSC 201 Data Structures Hiram College.
For Monday Read Weiss, chapter 7, sections 1-3. Homework –Weiss, chapter 4, exercise 6. Make sure you include parentheses where appropriate.
data ordered along paths from root to leaf
Chapter 21 Priority Queue: Binary Heap Saurav Karmakar.
1 Heaps and Priority Queues Starring: Min Heap Co-Starring: Max Heap.
CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
Symbol Tables and Search Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
Lec 15 Oct 18 Binary Search Trees (Chapter 5 of text)
CSC 213 – Large Scale Programming Lecture 15: Heap-based Priority Queue.
SNU IDB Lab. Ch.13 Priority Queues © copyright 2006 SNU IDB Lab.
COSC2007 Data Structures II Chapter 12 Tables & Priority Queues III.
Priority Queues and Heaps. October 2004John Edgar2  A queue should implement at least the first two of these operations:  insert – insert item at the.
1 Heaps and Priority Queues v2 Starring: Min Heap Co-Starring: Max Heap.
Priority Queues Two kinds of priority queues: Min priority queue. Max priority queue. Nov 4,
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
CS 361 – Chapter 5 Priority Queue ADT Heap data structure –Properties –Internal representation –Insertion –Deletion.
CS223 Advanced Data Structures and Algorithms 1 Priority Queue and Binary Heap Neil Tang 02/09/2010.
Lecture 15 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
SNU IDB Lab. Ch 15. Binary Search Trees © copyright 2006 SNU IDB Lab.
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables I.
HEAPS. Review: what are the requirements of the abstract data type: priority queue? Quick removal of item with highest priority (highest or lowest key.
FALL 2005CENG 213 Data Structures1 Priority Queues (Heaps) Reference: Chapter 7.
AVL Trees and Heaps. AVL Trees So far balancing the tree was done globally Basically every node was involved in the balance operation Tree balancing can.
FALL 2005CENG 351 Data Management and File Structures1 External Sorting Reference: Chapter 8.
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
Priority Queues CS 110: Data Structures and Algorithms First Semester,
CSI 312 Dr. Yousef Qawqzeh Heaps and Priority Queue.
1 Chapter 6 Heapsort. 2 About this lecture Introduce Heap – Shape Property and Heap Property – Heap Operations Heapsort: Use Heap to Sort Fixing heap.
Winner trees. Loser Trees.
Priority Queues CS /02/05 L7: PQs Slide 2 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved.
2 Binary Heaps What if we’re mostly concerned with finding the most relevant data?  A binary heap is a binary tree (2 or fewer subtrees for each node)
Course: Programming II - Abstract Data Types HeapsSlide Number 1 The ADT Heap So far we have seen the following sorting types : 1) Linked List sort by.
Heaps, Heap Sort, and Priority Queues. Background: Binary Trees * Has a root at the topmost level * Each node has zero, one or two children * A node that.
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables II.
Best-fit bin packing in O(n log n) time
Lecture 22 Binary Search Trees Chapter 10 of textbook
Binary Trees, Binary Search Trees
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
Lec 12 March 9, 11 Mid-term # 1 (March 21?)
Search Sorted Array: Binary Search Linked List: Linear Search
CENG 351 Data Management and File Structures
Heaps By JJ Shepherd.
Priority Queue and Heap
A Heap Is Efficiently Represented As An Array
Splay Trees Binary search trees.
Presentation transcript:

SNU IDB Lab. Ch.14 Tournament Trees © copyright 2006 SNU IDB Lab.

SNU IDB Lab. Data Structures 2 BIRD’S-EYE VIEW (0) Chapter 12: Binary Tree Chapter 13: Priority Queue Heap and Leftiest Tree Chapter 14: Tournament Trees Winner Tree and Loser Tree

SNU IDB Lab. Data Structures 3 BIRD’S-EYE VIEW A tournament tree is a complete binary tree that is most efficiently stored by using the array-based binary tree Study two varieties of tournament trees Winner tree Loser tree Tournament Tree Application Bin packing

SNU IDB Lab. Data Structures 4 Table of Contents Winner Tree Loser Trees Tournament Tree Applications Bin Packing Using First Fit (BPFF) Bin Packing Using Next Fit (BPNF)

SNU IDB Lab. Data Structures 5 Winner Tree Definition: A winner tree for n players is a complete binary tree with n external and n-1 internal nodes Each internal node records the winner of the match played there.

SNU IDB Lab. Data Structures 6 Max Winner tree The player with the larger value wins

SNU IDB Lab. Data Structures 7 Min Winner tree The player with the smaller value wins

SNU IDB Lab. Data Structures 8 Complexity of Winner Tree O(log(n)) time to restructure n player winner tree O(1) time to play match at each match node n - 1 match nodes O(n) time to initialize n player winner tree

SNU IDB Lab. Data Structures 9 WT Applications – Sorting (1) Min Winner Tree

SNU IDB Lab. Data Structures 10 WT Applications – Sorting (2) Sorted array

SNU IDB Lab. Data Structures 11 WT Applications – Sorting (3) Sorted array Restructuring starts at the place where “2” is removed

SNU IDB Lab. Data Structures 12 WT Applications – Sorting (4) Sorted array

SNU IDB Lab. Data Structures 13 WT Applications – Sorting (5) Sorted array

SNU IDB Lab. Data Structures 14 WT Applications – Sorting (6) Sorted array Restructuring starts at the place where “3” is removed

SNU IDB Lab. Data Structures 15 WT Applications – Sorting (7) Sorted array

SNU IDB Lab. Data Structures 16 WT Applications – Sorting (8) Sorted array

SNU IDB Lab. Data Structures 17 WT Applications – Sorting (9) Sorted array

SNU IDB Lab. Data Structures 18 WT Applications – Sorting (10) Sorted array Restructuring starts at the place where “4” is removed

SNU IDB Lab. Data Structures 19 WT Applications – Sorting (11) Sorted array

SNU IDB Lab. Data Structures 20 WT Applications – Sorting (12) Sorted array

SNU IDB Lab. Data Structures 21 WT Applications – Sorting (13) Sorted array

SNU IDB Lab. Data Structures 22 WT Applications – Sorting (14) Sorted array

SNU IDB Lab. Data Structures 23 WT Applications – Sorting (15) Sorted array

SNU IDB Lab. Data Structures 24 WT Applications – Sorting (16) Sorted array

SNU IDB Lab. Data Structures 25 WT Applications – Sorting (17) Sorted array

SNU IDB Lab. Data Structures 26 WT Applications – Sorting (18) Sorted array

SNU IDB Lab. Data Structures 27 WT Applications – Sorting (19) Sorted array

SNU IDB Lab. Data Structures 28 WT Applications – Sorting (20) Sorted array

SNU IDB Lab. Data Structures 29 WT Applications – Sorting (21) Sorted array

SNU IDB Lab. Data Structures 30 WT Applications – Sorting (22) Sorted array

SNU IDB Lab. Data Structures 31 WT Applications – Sorting (23) Sorted array

SNU IDB Lab. Data Structures 32 WT Applications – Sorting (24) Sorted array

SNU IDB Lab. Data Structures 33 WT Applications – Sorting (25) Sorted array

SNU IDB Lab. Data Structures 34 WT Applications – Sorting (26) Sorted array

SNU IDB Lab. Data Structures 35 Complexity of Winner-Tree Sorting Initialize winner tree: O(n) time Remove winner and replay: O(logn) time Remove winner and replay n times: O(n*logn) time Total sort time is O(n*logn) Actually Ɵ (n*logn)

SNU IDB Lab. Data Structures 36 The ADT WinnerTree AbstractDataType WinnerTree { instances complete binary trees with each node pointing to the winner of the match played there: the external nodes represent the players operations initialize(a) : initialize a winner tree for the players in array a getWinner() : return the tournament winner rePlay(i) : replay matches following a change in player i }

SNU IDB Lab. Data Structures 37 Replace Winner and Replay (1) Suppose replace winner “ 2 ” with the new value “ 6 ” Changing the the value of the winner requires a replay of all matches on the path from the winner’s external node to the root Tree Height O(log n) time  more precisely Ɵ (log n)

SNU IDB Lab. Data Structures 38 Replace Winner and Replay (2) rePlay(6) : start rematch on player 6 whose value is now “6”

SNU IDB Lab. Data Structures 39 Replace Winner and Replay (3) st match Player 6 is a[12] in the array: the first match result between a[11] and a[12] is stored in a[5]

SNU IDB Lab. Data Structures 40 Replace Winner and Replay (4) nd match Change in a[5] causes a rematch between a[5] and a[6]. The match result is stored in a[2].

SNU IDB Lab. Data Structures 41 Replace Winner and Replay (5) rd match = Log 2 8 Change in a[2] causes a rematch between a[1] and a[2]. The match result is stored in a[0].

SNU IDB Lab. Data Structures 42 Table of Contents Winner Trees Loser Trees Tournament Tree Applications Bin Packing Using First Fit (BPFF) Bin Packing Using Next Fit (BPNF)

SNU IDB Lab. Data Structures 43 Loser Trees Each match node stores the match loser rather than the match winner The loser of final match a< c< a< f< g< f< Min Loser Tree The winner of final match f< Can reduce the work when the winner value is changed Show the better performance than the winner tree

SNU IDB Lab. Data Structures 44 Replay in 8-Player Min Winner Tree (1) Suppose we change f (key 2) with a new key 5 f a f ac fg abcdefgh

SNU IDB Lab. Data Structures 45 Replay in 8-Player Min Winner Tree (2) We should compare f' with e (=another child of parent of f') Need referencing twice (self  parent  sibling) f a f ac f'g abcde gh

SNU IDB Lab. Data Structures 46 Replay in 8-Player Min Winner Tree (3) We should compare f' with g (=another child of parent of f') Need referencing twice (self  parent  sibling) f a g ac g abcdgh f' e 5

SNU IDB Lab. Data Structures 47 Replay in 8-Player Min Winner Tree (4) We should compare g with a (=another child of parent of g) Need referencing twice (self  parent  sibling) f a g ac g abcdgh f' e 5

SNU IDB Lab. Data Structures 48 Replay in 8-Player Min Loser Tree (1) Suppose we change winner f (key 2) with a new key 5 a c g bd eh abcdefgh f Special case: The key of winner is changed 5

SNU IDB Lab. Data Structures 49 Replay in 8-Player Min Loser Tree (2) We simply compare f' with its parent because previous loser is stored at parent node Need referencing only once (self  parent) a c g bd e h abcde f' gh f

SNU IDB Lab. Data Structures 50 Replay in 8-Player Min Loser Tree (3) We simply compare f' with its parent because previous loser is stored at parent node Need referencing only once (self  parent) a c g bd e h abcdef'gh f

SNU IDB Lab. Data Structures 51 Replay in 8-Player Min Loser Tree (4) We simply compare g with its parent because previous loser is stored at parent node Need referencing only once (self  parent) a c f' bd eh abcde gh f

SNU IDB Lab. Data Structures 52 Replay in 8-Player Min Loser Tree (5) Winner changes to g a c f' bd eh abcde gh f g

SNU IDB Lab. Data Structures 53 Replay in 8-Player Min Loser Tree (6) Suppose we change d (key 9) with a new key 3 We should compare d with its sibling(c), NOT parent(d) a c g bd eh abcdefgh f The loser tree is not effective if the changed node is not the previous winner 3

SNU IDB Lab. Data Structures 54 Table of Contents Winner Trees Loser Trees Tournament Tree Applications Bin Packing Using First Fit (BPFF) Bin Packing Using Next Fit (BPNF)

SNU IDB Lab. Data Structures 55 Bin Packing Problem Object i requires objectSize[i] units of capacity 0 < objectSize[i] ≤ binCapacity A feasible packing is an assignment of objects to bins so that no bin’s capacity is exceeded Optimal packing: A feasible packing using the fewest number of bins First-Fit: find the first available bin using the winner tree Next-Fit: A variant of First-Fit searching the next bins

SNU IDB Lab. Data Structures 56 First-Fit and Winner Trees (1) Initialize: Winner tree of 8 bins and binCapacity = 10 If the players have the same value, the player with the small index is winner Suppose objects to be allocated are [ 8, 6, 5, 3] We want a feasible packing with a fewest number of bins Tree[1] Tree[2] Tree[3] Tree[4]Tree[5]Tree[6]Tree[7]

SNU IDB Lab. Data Structures 57 First-Fit and Winner Trees (2) Suppose objects to be allocated are [ 8, 6, 5, 3] objectSize[1] is 8 Bin[tree[1]].unusedCapacity >= objectSize[1]  go to left 10 > Tree[1] Tree[2] Tree[4]

SNU IDB Lab. Data Structures 58 First-Fit and Winner Trees (3) Bin[tree[2]].unusedCapacity >= objectSize[1]  go to left 10 >

SNU IDB Lab. Data Structures 59 First-Fit and Winner Trees (4) Bin[tree[4]].unusedCapacity >= objectSize[1]  go to left 10 > Tree[4]

SNU IDB Lab. Data Structures 60 First-Fit and Winner Trees (5) Object with size “8” is now in Bin[1] Need to update the winner tree

SNU IDB Lab. Data Structures 61 First-Fit and Winner Trees (6) Replay: start rematch at Tree[4] Tree[4] 8

SNU IDB Lab. Data Structures 62 First-Fit and Winner Trees (7) Rematch at Tree[3] Tree[3] 8

SNU IDB Lab. Data Structures 63 First-Fit and Winner Trees (8) Tree[1] Tree[2] Tree[4] Rematch at Tree[1] 8

SNU IDB Lab. Data Structures 64 First-Fit and Winner Trees (9) Suppose objects to be allocated are [ 8, 6, 5, 3] objectSize[2] = Tree[1]

SNU IDB Lab. Data Structures 65 First-Fit and Winner Trees (10) Bin[tree[1]].unusedCapacity >= objectSize[2] 10 > Tree[1]

SNU IDB Lab. Data Structures 66 First-Fit and Winner Trees (11) Bin[tree[2]].unusedCapacity >= objectSize[2] 10 > Tree[1] Tree[2] Tree[4] 8

SNU IDB Lab. Data Structures 67 First-Fit and Winner Trees (12) Bin[tree[4]].unusedCapacity >= objectSize[2] 10 >

SNU IDB Lab. Data Structures 68 First-Fit and Winner Trees (13) Object with size “6” is now in Bin[2]

SNU IDB Lab. Data Structures 69 First-Fit and Winner Trees (14) Update the winner tree 86

SNU IDB Lab. Data Structures 70 First-Fit and Winner Trees (15) Update the winner tree 86

SNU IDB Lab. Data Structures 71 First-Fit and Winner Trees (16) Update the winner tree 86

SNU IDB Lab. Data Structures 72 First-Fit and Winner Trees (17) Suppose objects to be allocated are [ 8, 6, 5, 3] objectSize[3] =

SNU IDB Lab. Data Structures 73 First-Fit and Winner Trees (18) Bin[tree[1]].unusedCapacity >= objectSize[3] 10 >

SNU IDB Lab. Data Structures 74 First-Fit and Winner Trees (19) Bin[tree[2]].unusedCapacity >= objectSize[3] 10 >

SNU IDB Lab. Data Structures 75 First-Fit and Winner Trees (20) Bin[tree[4]].unusedCapacity < objectSize[3] 4 <

SNU IDB Lab. Data Structures 76 First-Fit and Winner Trees (21) Go to sibling: Bin[tree[5]].unusedCapacity >= objectSize[3] 10 >

SNU IDB Lab. Data Structures 77 First-Fit and Winner Trees (22) Object with size “5” is now in Bin[3]

SNU IDB Lab. Data Structures 78 First-Fit and Winner Trees (23) Update the winner tree 86 5

SNU IDB Lab. Data Structures 79 First-Fit and Winner Trees (24) Update the winner tree 86 5

SNU IDB Lab. Data Structures 80 First-Fit and Winner Trees (25) Update the winner tree 86 5

SNU IDB Lab. Data Structures 81 First-Fit and Winner Trees (26) Suppose objects to be allocated are [ 8, 6, 5, 3] objectSize[4] =

SNU IDB Lab. Data Structures 82 First-Fit and Winner Trees (27) Bin[tree[1]].unusedCapacity >= objectSize[4] 10 > Tree[1] Tree[2] 86 5

SNU IDB Lab. Data Structures 83 First-Fit and Winner Trees (28) Bin[tree[2]].unusedCapacity >= objectSize[4] 10 > Tree[1] Tree[2] 86 5

SNU IDB Lab. Data Structures 84 First-Fit and Winner Trees (29) Bin[tree[4]].unusedCapacity >= objectSize[4] 4 > Tree[1] Tree[2] Tree[4] 86 5

SNU IDB Lab. Data Structures 85 First-Fit and Winner Trees (30) Object with size “3” is now in bin[2] , 3 5

SNU IDB Lab. Data Structures 86 First-Fit and Winner Trees (31) Update the winner tree 86, 3 5

SNU IDB Lab. Data Structures 87 First Fit and Winner Trees (32) Update the winner tree 86, 3 5

SNU IDB Lab. Data Structures 88 First-Fit and Winner Trees (33) Update the winner tree 86, 3 5

SNU IDB Lab. Data Structures 89 The method firstFitPack() (1) public static void firstFitPack(int [] objectSize, int binCapacity) { int n = objectSize.length - 1; // number of objects Bin [] bin = new Bin [n + 1]; // bins ExtendedCWTree winTree = new ExtendedCWTree(); for (int i = 1; i <= n; i++) // initialize n bins and winner tree bin[i] = new Bin(binCapacity); // initial unused capacity winTree.initialize(bin); // put objects in bins for (int i = 1; i <= n; i++) { // put object i into a bin // find first bin with enough capacity int child = 2; // start search at left child of root while (child < n) { int winner = winTree.getWinner(child); if (bin[winner].unusedCapacity < objectSize[i]) child++ ; // first bin is in right subtree child *= 2; // move to left child }

SNU IDB Lab. Data Structures 90 The method firstFitPack() (2) int binToUse; // will be set to bin to use child /= 2; // undo last left-child move if (child < n) { // at a tree node binToUse = winTree.getWinner(child); // if binToUse is right child, need to check bin binToUse-1. // No harm done by checking bin binToUse-1 even if binToUse is left child. if (binToUse > 1 && bin[binToUse - 1].unusedCapacity >= objectSize[i]) binToUse--; } else binToUse = winTree.getWinner(child / 2); // arises when n is odd System.out.println("Pack object " + i + " in bin " + binToUse); bin[binToUse].unusedCapacity -= objectSize[i]; winTree.rePlay(binToUse); } ** O(nlogn) time using a winner tree

SNU IDB Lab. Data Structures 91 Table of Contents Winner Trees Loser Trees Tournament Tree Applications Bin Packing Using First Fit (BPFF) Bin Packing Using Next Fit (BPNF)

SNU IDB Lab. Data Structures 92 Next-Fit For the new object, we determine the next nonempty bin that can accommodate the object by polling the bins in a round robin fashion We want a feasible packing with a fewest number of bins 3 bins of size 7 and six objects [3,5,3,4,2,1] 3 goes to bin[1] 5 goes to bin[2] // the candidate is bin[2] & check the left side; bin[2] is OK. 3 goes to bin[1] // the candidate is bin[3] & check the left side; bin[1] is better 4 goes to bin[3] // the candidate is bin[3] & check the left side; bin[3] is OK 2 goes to bin[2] // first check bin[1], but not qualified; bin[2] is qualified 1 goes to bin[3] // frist check bin[3], but not qualified; bin[3] is qualified Idea (O(n) for one assignment) Search for the next bin of the last used bin which can accommodate the new object If the candidate bin is not empty, use it Otherwise search for the left-most bin which can accommodate the new object

SNU IDB Lab. Data Structures 93 Next-Fit with Winner Tree Step 1 (Figure 14.8 in textbook) Search the suitable bin with help of winner tree If the found bin is empty, go to step 2 O(log(n)) Step 2 (actually First-Fit) Search the left-most suitable bin with help of winner tree O(log(n))

SNU IDB Lab. Data Structures 94

SNU IDB Lab. Data Structures 95 Next-Fit with Winner Tree (1) Suppose the size of a new object to be allocated is 7 &LastUsedBin is bin[1] Start from bin[2] & bin[3]; go to parent of bin[2] (which is tree[4]) go to tree[2] & try tree[3]; The unusedCapacity of tree[3] is 10, try to find the first bin of tree[3] which can accommodate “7” Tree[1] Tree[2] Tree[3] Tree[4]Tree[5]Tree[6]Tree[7]

SNU IDB Lab. Data Structures 96 Next-Fit and Winner Tree (2) Suppose the size of a new object to be allocated is 9 &LastUsedBin is bin[3] Start from bin[4] & bin[5]; go to the parent of bin[4] (which is tree[5]) Go to tree[2] and try tree[3] The unusedCapacity of tree[3] is 10, try to find the first bin of tree[3] which can accommodate “9”  bin[7] is the candidate, but empty We check the left-most bin which can accommodate “9”  No such bin  bin[7] is the bin to use Tree[1] Tree[2]Tree[3] Tree[4] Tree[5] Tree[6] Tree[7]

SNU IDB Lab. Data Structures 97 Summary A tournament tree is a complete binary tree that is most efficiently stored by using the array-based binary tree Study two varieties of tournament trees Winner tree Loser tree Tournament Tree Application Bin Packing Using First Fit (BPFF) Bin Packing Using Next Fit (BPNF)