Download presentation

Presentation is loading. Please wait.

Published byRaul Ramshaw Modified over 3 years ago

1
Selection Trees

2
What are selection trees? Complete binary tree Each node represents a “match” Winner Trees Loser Trees

3
Diagram – max winner tree 9585548 988 5 89 9 4 7 0 … 3 6 9 … 1 5 2 … 8 6 7 … 5 3 0 … 5 4 1 … 2 8 3 … 4 1 3 … 7

4
Diagram – max loser tree 9585548 754 5 55 4 7 4 0 … 9 6 3 … 5 2 1 … 8 7 6 … 5 3 0 … 5 4 1 … 8 3 2 … 4 3 1 … 7

5
Runtimes Complexities Initialize r = the number of runs = number of leaf nodes r-1 comparison nodes O(r) to initialize r-runs Compare O(1) Remove winner and Replay O(logr) Total Time for n elements O(nlogr)

6
What’s this good for? External Sorting Package Loading Problem

7
Truck Loading Problem n parcels from r sources each parcel has a weight and a size minimize the number of trucks

8
First Fit Packing with Max Winner Tree Use a max winner tree in which n parcels are t trucks One at a time in left to right order Current item is packed in the left-most into which it fits If there is no truck into which it fits, start a new truck

9
Best Fit Object is packed into the bin with the least unused capacity that is at least the size of the object If conditions are not met, start a new truck

Similar presentations

OK

Data Structure II So Pak Yeung 26-2-2011. Outline Review Array Sorted Array Linked List Binary Search Tree Heap Hash Table.

Data Structure II So Pak Yeung 26-2-2011. Outline Review Array Sorted Array Linked List Binary Search Tree Heap Hash Table.

© 2018 SlidePlayer.com Inc.

All rights reserved.

To ensure the functioning of the site, we use **cookies**. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy & Terms.
Your consent to our cookies if you continue to use this website.

Ads by Google

Ppt on low level language Ppt on porter's five forces model example Free download ppt on surface chemistry Ppt on taj mahal agra Ppt on object-oriented concepts interview questions Ppt on file system in unix shell Ppt on forward rate agreement Ppt on electrical engineering major projects Ppt on domain name space Ppt on migration of birds in india