A Worst Case, Constant Time Priority Queue

Slides:



Advertisements
Similar presentations
1 Cache and Caching David Sands CS 147 Spring 08 Dr. Sin-Min Lee.
Advertisements

Msb(x) in O(1) steps using 5 multiplications Word size n = g∙g, g a power of 2 [M.L. Fredman, D.E. Willard, Surpassing the information-theoretic bound.
CS 332: Algorithms Binary Search Trees. Review: Dynamic Sets ● Next few lectures will focus on data structures rather than straight algorithms ● In particular,
Succinct Data Structures Ian Munro University of Waterloo Joint work with David Benoit, Andrej Brodnik, D, Clark, F. Fich, M. He, J. Horton, A. López-Ortiz,
Succinct Representations of Trees S. Srinivasa Rao Seoul National University.
Pipelined van Emde Boas Tree: Algorithms, Analysis, and Applications Hao Wang and Bill Lin University of California, San Diego.
1 Succinct Priority Indexing Structures for the Management of Large Priority Queues Hao Wang and Bill Lin University of California, San Diego IEEE IWQoS.
BST Data Structure A BST node contains: A BST contains
10/22/2002CSE Red Black Trees CSE Algorithms Red-Black Trees Augmenting Search Trees Interval Trees.
Cache Oblivious Search Trees via Binary Trees of Small Height
David Luebke 1 7/2/2015 ITCS 6114 Binary Search Trees.
David Luebke 1 7/2/2015 Medians and Order Statistics Structures for Dynamic Sets.
B-Trees (continued) Analysis of worst-case and average number of disk accesses for an insert. Delete and analysis. Structure for B-tree node.
Mike 66 Sept Succinct Data Structures: Techniques and Lower Bounds Ian Munro University of Waterloo Joint work with/ work of Arash Farzan, Alex Golynski,
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
David Luebke 1 9/18/2015 CS 332: Algorithms Red-Black Trees.
Data structures for Bandwidth Reservations and Quality of Service on the Internet Andreas Nilsson Division of Computer Science and Networking Department.
Space Efficient Data Structures for Dynamic Orthogonal Range Counting Meng He and J. Ian Munro University of Waterloo.
Wolfgang Mulzer Institut f ür Informatik Data Structures on Event Graphs Bernard ChazelleWolfgang Mulzer FU Berlin Princeton University.
Trevor Brown – University of Toronto B-slack trees: Space efficient B-trees.
The Binary Heap. Binary Heap Looks similar to a binary search tree BUT all the values stored in the subtree rooted at a node are greater than or equal.
Integer Representations and Counting in the Bit Probe Model M. Zaiur Rahman and J. Ian Munro Cheriton School of Computer Science University of Waterloo.
Succinct Data Structures Ian Munro University of Waterloo Joint work with David Benoit, Andrej Brodnik, D, Clark, F. Fich, M. He, J. Horton, A. López-Ortiz,
CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
A Worst Case, Constant Time Priority Queue: Beating a Lower Bound Ian Munro University of Waterloo Joint work with Andrej Brodnik (Ljubljana & Luleå) Svante.
An experimental study of priority queues By Claus Jensen University of Copenhagen.
Symbol Tables and Search Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
1 Searching Searching in a sorted linked list takes linear time in the worst and average case. Searching in a sorted array takes logarithmic time in the.
B-Tree – Delete Delete 3. Delete 8. Delete
Implicit Dictionaries with O(1) Modifications per Update and Fast Search Gianni Franceschini and Ian Munro  Elements kept in 1 st n positions of an array.
A Static Data Structure for Discrete Advance Bandwidth Reservations on the Internet Andrej Brodnik Andreas Nilsson CSEE Luleå University of Technology.
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Red-Black Trees. Review: Binary Search Trees ● Binary Search Trees (BSTs) are an important data structure for dynamic sets ● In addition to satellite.
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
CSE 2331/5331 Topic 8: Binary Search Tree Data structure Operations.
B-Trees Katherine Gurdziel 252a-ba. Outline What are b-trees? How does the algorithm work? –Insertion –Deletion Complexity What are b-trees used for?
Trees CSIT 402 Data Structures II 1. 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical.
8/3/2007CMSC 341 BTrees1 CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
(A Survey on) Priority Queues IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013 Gerth Stølting Brodal Aarhus Universty.
1 Red-Black Trees. 2 A Red-Black Tree with NULLs shown Black-Height of the tree = 4.
CSE 373 Data Structures Lecture 7
Priority Queue A Priority Queue Set S is made up of n elements: x0 x1 x2 x3 … xn-1 Functions: createEmptySet() returns a newly created empty priority.
lsb(x) = Least Significant Bit ?
Multiway Search Trees Data may not fit into main memory
Indexing ? Why ? Need to locate the actual records on disk without having to read the entire table into memory.
Experimental evaluation of Navigation piles
Priority Queues and Heaps
Red Black Trees
B+ Trees Similar to B trees, with a few slight differences
O(lg n) Search Tree Tree T is a search tree made up of n elements: x0 x1 x2 x3 … xn-1 No function (except transverse) takes more than O(lg n) in the.
CMSC 341 Lecture 10 B-Trees Based on slides from Dr. Katherine Gibson.
Fast Trie Data Structures
B-Trees (continued) Analysis of worst-case and average number of disk accesses for an insert. Delete and analysis. Structure for B-tree node.
Segment Trees Basic data structure in computational geometry.
B- Trees D. Frey with apologies to Tom Anastasio
B- Trees D. Frey with apologies to Tom Anastasio
Red-Black Trees.
Random inserting into a B+ Tree
B- Trees D. Frey with apologies to Tom Anastasio
MTree An implementation and An example with m=3
Balanced binary search trees
Topic 6: Binary Search Tree Data structure Operations
Binary and Binomial Heaps
Topic 5: Heap data structure heap sort Priority queue
Melding Priority Queues
ITCS6114 Algorithms and Data Structures
Succinct Data Structures
1 Lecture 13 CS2013.
Chapter 12&13: Binary Search Trees (BSTs)
Presentation transcript:

A Worst Case, Constant Time Priority Queue Ian Munro University of Waterloo Joint work with Andrej Brodnik (Ljubljana & Luleå) Svante Carlsson (Blekinge Inst. Tech.) Johan Karlsson (Luleå)

The Problem van Emde Boas (SWAT i.e. FOCS 1975) Universe integers [1,..m] {n of which are present} Operations: insert / delete find least value  x (or greatest ) Bound: O(lg lg m) time Space: Improved to O(m) bits Model: Standard RAM, with bit twiddling

Some Subsequent Work Kurt Mehlhorn, Stephan Näher and Helmut Alt (SiComp ‘88): vEB is optimal - Lower bound (lg lg m) on pointer machine Peter Miltersen (STOC ‘94): Lower bound ( lg lg m) on a RAM Paul Beame and Faith Fich (STOC ‘99): return to parameterization by number of values actually present - matching upper & lower bounds- (lg n/ lg lg n)

Another Model: Rambo Random Access Machine with Byte Overlap Mike Fredman and Dan Willard Several words can share bits:

Can we do better under this model? Consider elements at bottom an internal node is flagged if it has a descendant lg n bit RAMBO word at leaf Can find lowest ancestor in O(1) time

The vEB Stratified Tree Internal node keeps track of “outside” bottom elements 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

A Problem Any individual leaf may be referred to by many ancestors So one insertion/deletion can require up to 2lg n reference changes Modify the approach

Each leaf can be referred to by at most two ancestors Split Tagged Tree Keep track of left / right inside leaf … if different from parent’s Each leaf can be referred to by at most two ancestors

So what do we have? Constant time “extended priority queue” … two memory accesses for search, three for update on our model How much space do we need? 2m + O(lg m) bits of ordinary RAM m bits of RAMBO memory in a particular configuration we call Yggdrasil and it has been implemented in hardware