List Order Maintenance

Slides:



Advertisements
Similar presentations
Worksheets.
Advertisements

Table de multiplication, division, addition et soustraction.
Feichter_DPG-SYKL03_Bild-01. Feichter_DPG-SYKL03_Bild-02.
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Slide 1 Insert your own content. Slide 2 Insert your own content.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 116.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 28.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 38.
Chapter 1 Image Slides Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Reducing Fractions. Factor A number that is multiplied by another number to find a product. Factors of 24 are (1,2, 3, 4, 6, 8, 12, 24).
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Photo Slideshow Instructions (delete before presenting or this page will show when slideshow loops) 1.Set PowerPoint to work in Outline. View/Normal click.
David Luebke 1 6/1/2014 CS 332: Algorithms Medians and Order Statistics Structures for Dynamic Sets.
CS16: Introduction to Data Structures & Algorithms
Break Time Remaining 10:00.
1 Parallel Algorithms (chap. 30, 1 st edition) Parallel: perform more than one operation at a time. PRAM model: Parallel Random Access Model. p0p0 p1p1.
1 Hash Tables Saurav Karmakar. 2 Motivation What are the dictionary operations? What are the dictionary operations? (1) Insert (1) Insert (2) Delete (2)
Briana B. Morrison Adapted from William Collins
15. Oktober Oktober Oktober 2012.
1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I.
Outcome: Determine the square root of perfect squares.
Squares and Square Root WALK. Solve each problem REVIEW:
We are learning how to read the 24 hour clock
1..
Sum Selection in Arrays Allan Grønlund Jørgensen Kvalifikationseksamen.
Rahnuma Islam Nishat Debajyoti Mondal Md. Saidur Rahman Graph Drawing and Information Visualization Laboratory Department of Computer Science and Engineering.
CSE 4101/5101 Prof. Andy Mirzaian B-trees trees.
Artificial Intelligence
23-8 3x6 Double it Take Away 6 Share By 9 Double it +10 Halve it Beginner Start Answer Intermediate 70 50% of this ÷7÷7 x8 Double it Start Answer.
Addition 1’s to 20.
25 seconds left…...
Test B, 100 Subtraction Facts
: 3 00.
Week 1.
2 x0 0 12/13/2014 Know Your Facts!. 2 x1 2 12/13/2014 Know Your Facts!
We will resume in: 25 Minutes.
2 x /18/2014 Know Your Facts!. 11 x /18/2014 Know Your Facts!
Rizwan Rehman Centre for Computer Studies Dibrugarh University
Clock will move after 1 minute
2 x /10/2015 Know Your Facts!. 8 x /10/2015 Know Your Facts!
2.4 – Factoring Polynomials Tricky Trinomials The Tabletop Method.
Other Dynamic Programming Problems
Select a time to count down from the clock above
Strategies – Multiplication and Division
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
5 x4. 10 x2 9 x3 10 x9 10 x4 10 x8 9 x2 9 x4.
Parallel algorithms for expression evaluation Part1. Simultaneous substitution method (SimSub) Part2. A parallel pebble game.
Linear Programming – Simplex Method: Computational Problems Breaking Ties in Selection of Non-Basic Variable – if tie for non-basic variable with largest.
The Problem of K Maximum Sums and its VLSI Implementation Sung Eun Bae, Tadao Takaoka University of Canterbury Christchurch New Zealand.
Multiplication Facts Practice
Graeme Henchel Multiples Graeme Henchel
The Project Problem formulation (one page) Literature review –“Related work" section of final paper, –Go to writing center, –Present paper(s) to class.
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
Adding & Subtracting Mixed Numbers. Objective: To develop fluency in +, –, x, and ÷ of non-negative rational numbers. Essential Question: How.
7x7=.
Priority Queues  MakeQueuecreate new empty queue  Insert(Q,k,p)insert key k with priority p  Delete(Q,k)delete key k (given a pointer)  DeleteMin(Q)delete.
1 Self-Adjusting Data Structures. 2 Lists [D.D. Sleator, R.E. Tarjan, Amortized Efficiency of List Update Rules, Proc. 16 th Annual ACM Symposium on Theory.
Update 1 Persistent Data Structures (Version Control) v0v0 v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 Ephemeral query v0v0 v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 Partial persistence.
Fully Persistent B-Trees 23 rd Annual ACM-SIAM Symposium on Discrete Algorithms, Kyoto, Japan, January 18, 2012 Gerth Stølting Brodal Konstantinos Tsakalidis.
Time O(log d) Exponential-search(13) Finger Search Searching in a sorted array time O(log n) Binary-search(13)
Λίστα Εργασιών Data Structures for Tree Manipulation D. Harel and R.E. Tarjan. Fast Algorithms for finding nearest common ancestors. SIAM J. Computing,
Self-Adjusting Data Structures
List Order Maintenance
Persistent Data Structures (Version Control)
Presentation transcript:

List Order Maintenance B H D I C F G A Insert(D,I) Build data structure Insert(x,y) Insert y after x Order(x,y) Returns if x is to the left of y Monotonic List Labeling 10 12 14 17 18 19 20 21 24 x y Each node an integer label Relabel nodes on insertion Insert(x,y) Insert y after x Density Maintenance 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 A J C G D B F H E File gap O(1) Insert(i,x) Insert x at postion i Shift elements on insertion

List Order Maintenance [P. Dietz, D. Sleator, Two algorithms for maintaining order in a list, ACM Conference on Theory of Computing, 365-372, 1987] [A. Tsakalidis, Maintaining Order in a Generalized Linked List. Acta Informatica 21: 101-112, 1984] Query and Insert O(1) Monotonic List Labeling [P. Dietz, Maintaining Order in a Linked List, ACM Conference on Theory of Computing, 122-127, 1982] [P. Dietz, J. Seiferas, J. Zhang: A Tight Lower Bound for On-line Monotonic List Labeling. Scandinavian Workshop on Algorithm Theory, 131-142, 1994] Max label O(nk) (log n) relabelings [D. Willard, Maintaining Dense Sequential Files in a Dynamic Environment, ACM Conference on Theory of Computing, 114-121, 1982] [P. Dietz, J. Zhang: Lower Bounds for Monotonic List Labeling. Scandinavian Workshop on Algorithm Theory, 173-180, 1990] Max label O(n) (log2 n) relabelings Applications [G. Brodal, R. Fagerberg, R. Jacob, Cache-Oblivious Search Trees via Binary Trees of Small Height, ACM-SIAM Symposium on Discrete Algorithms, pages 39-48, 2002] [J. Driscoll, N. Sarnak, D. Sleator, R. Tarjan, Making Data Structures Persistent, Journal of Computer and System Sciences, 38(1), 86-124, 1989]

Amortized O(log2 n) Density Maintenance Threshold  = 1/(2log n) Level i node overflows if density > 1-i∙ Insert redistribute lowest non-overflowing ancestor  a child requires  fraction insertions before next overflow  amoritzed insertion cost = #levels ∙ 1 /  = O(log2 n) redistribution threshold level redistribute 4 4/8 density 5/8 3 5/8 4/4 2 6/8 3/2 1 7/8 2/1 1 Insert(6,K) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 A J C G D B F H E before after A J K C G D B F H E

 List Order Maintenance Max label O(n) Amortized O(log2 n) Density Maintenance Threshold  = 1/(2log n) Level i node overflows if density > 1-i∙ Insert redistribute lowest non-overflowing ancestor  a child requires  fraction insertions before next overflow  amoritzed insertion cost = #levels ∙ 1 /  = O(log2 n)  List Order Maintenance Max label O(n) Amortized O(log2 n) relabelings / insertion redistribution threshold level redistribute 4 4/8 density 5/8 3 5/8 4/4 2 6/8 3/2 1 7/8 2/1 1 Insert(6,K) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 A J C G D B F H E before after A J K C G D B F H E

Amortized O(log n) List Relabelings Level i node overflows if density > (2/3)i Insert redistribute lowest non-overflowing ancestor  ≤ log4/3 n levels  max label 2log4/3 n ≤ n2.41  a child requires 1/2 fraction insertions before next overflow  amoritzed insertion cost = #levels ∙ 3 = O(log n) 2/3  1/2 +  implies max label n1+O() redistribution threshold level redistribute density 3/16 4 16/81 3/8 3 8/27 2/4 2 4/9 2/2 1 2/3 2/1 1 Insert(C,K) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 A C before after A C K

Amortized O(log n) List Relabelings [P. Dietz, D. Sleator, Two algorithms for maintaining order in a list, ACM Conference on Theory of Computing, 365-372, 1987] 1 2 4 5 7 8 9 12 15 17 18 19 21 23 i wi = 12 - 8 2i w2i = 18 - 8 i = 1 while w2i ≤ 4 ∙ wi do i = i +1 Relabel uniformly ”2i area” Only relabels to the right Relabeling area k : wk = (k2) Requires labels mod O(n2)

Monotonic List Labeling O(log N) easy insertions N 32 48 56 60 64 128 192 256 x y Insert(x,y) Label y = (left + right)/2  Can perform log N insertions without relabeling

Amortized O(1) List Order Maintenance top-tree of size ≤ n/log2 n Amortized O(log2 n) Density Maintenance 1 2 4 5 7 8 9 11 12 15 17 18 19 21 23 ... 12 16 7 13 the list 8 16 4 12 5 15 2 14 two-level bucket of degree [log n..2log n] and keys [0..n2] Insertion create and label new leaf split nodes of degree > 2log n and relabel with gap n insert in top tree

Amortized O(1) List Order Maintenance Worst-case Worst-case [Willard 1982] top-tree of size ≤ n/log2 n Amortized O(log2 n) Density Maintenance 1 2 4 5 7 8 9 11 12 15 17 18 19 21 23 ... 12 16 7 13 the list three 8 16 4 12 5 15 2 14 two-level bucket of degree [log n..2log n] and keys [0..n2] Insertion create and label new leaf split nodes of degree > 2log n and relabel with gap n insert in top tree + incremental insertion into top tree + incremental splitting of bucket nodes + every O(log2 n)’th operation split largest bucket largest bucket size O(log3 n)

a9 a5 a12 a11 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 ... xn