Engineering a Sorted List Data Structure for 32 Bit Keys Roman Dementiev Lutz Kettner Jens Mehnert Peter Sanders MPI für Informatik, Saarbrücken.

Slides:



Advertisements
Similar presentations
David Luebke 1 6/7/2014 CS 332: Algorithms Skip Lists Introduction to Hashing.
Advertisements

Comp 122, Spring 2004 Hash Tables – 1. hashtables - 2 Lin / Devi Comp 122, Fall 2003 Dictionary Dictionary: »Dynamic-set data structure for storing items.
COL 106 Shweta Agrawal and Amit Kumar
The Dictionary ADT Definition A dictionary is an ordered or unordered list of key-element pairs, where keys are used to locate elements in the list. Example:
Heaps1 Part-D2 Heaps Heaps2 Recall Priority Queue ADT (§ 7.1.3) A priority queue stores a collection of entries Each entry is a pair (key, value)
Bio Michel Hanna M.S. in E.E., Cairo University, Egypt B.S. in E.E., Cairo University at Fayoum, Egypt Currently is a Ph.D. Student in Computer Engineering.
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.
Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu.
Binary Heaps CSE 373 Data Structures Lecture 11. 2/5/03Binary Heaps - Lecture 112 Readings Reading ›Sections
More sorting algorithms: Heap sort & Radix sort. Heap Data Structure and Heap Sort (Chapter 7.6)
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.
Lower and Upper Bounds on Obtaining History Independence Niv Buchbinder and Erez Petrank Technion, Israel.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
The Most Commonly-used Data Structures
Objectives Learn how to implement the sequential search algorithm Explore how to sort an array using the selection sort algorithm Learn how to implement.
Cache Oblivious Search Trees via Binary Trees of Small Height
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Priority Queues1 Part-D1 Priority Queues. Priority Queues2 Priority Queue ADT (§ 7.1.3) A priority queue stores a collection of entries Each entry is.
PQ, binary heaps G.Kamberova, Algorithms Priority Queue ADT Binary Heaps Gerda Kamberova Department of Computer Science Hofstra University.
Heaps and heapsort COMP171 Fall 2005 Part 2. Sorting III / Slide 2 Heap: array implementation Is it a good idea to store arbitrary.
The Design and Analysis of Algorithms
Important Problem Types and Fundamental Data Structures
Data Structures Lecture-1:Introduction
Maps A map is an object that maps keys to values Each key can map to at most one value, and a map cannot contain duplicate keys KeyValue Map Examples Dictionaries:
CSCE 3110 Data Structures & Algorithm Analysis Binary Search Trees Reading: Chap. 4 (4.3) Weiss.
1 Hash Tables  a hash table is an array of size Tsize  has index positions 0.. Tsize-1  two types of hash tables  open hash table  array element type.
ADT Table and Heap Ellen Walker CPSC 201 Data Structures Hiram College.
Information and Computer Sciences University of Hawaii, Manoa
Jessie Zhao Course page: 1.
Sorting with Heaps Observation: Removal of the largest item from a heap can be performed in O(log n) time Another observation: Nodes are removed in order.
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.
data ordered along paths from root to leaf
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Standard Template Library (STL)
Survey of Sorting Ananda Gunawardena. Naïve sorting algorithms Bubble sort: scan for flips, until all are fixed Etc...
PRIORITY QUEUES AND HEAPS CS16: Introduction to Data Structures & Algorithms Tuesday, February 24,
Chapter 2: Basic Data Structures. Spring 2003CS 3152 Basic Data Structures Stacks Queues Vectors, Linked Lists Trees (Including Balanced Trees) Priority.
Been-Chian Chien, Wei-Pang Yang, and Wen-Yang Lin 8-1 Chapter 8 Hashing Introduction to Data Structure CHAPTER 8 HASHING 8.1 Symbol Table Abstract Data.
Priority Queues and Heaps. October 2004John Edgar2  A queue should implement at least the first two of these operations:  insert – insert item at the.
Searching and Sorting Recursion, Merge-sort, Divide & Conquer, Bucket sort, Radix sort Lecture 5.
CSCI 4333 Database Design and Implementation – Exercise (5) Xiang Lian The University of Texas – Pan American Edinburg, TX
Disjoint-sets Abstract Data Type (ADT) that contains nonempty pairwise disjoint sets: For all sets X and Y in the container, – X != ϴ and Y != ϴ – And.
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Review for Exam 2 Topics covered (since exam 1): –Splay Tree –K-D Trees –RB Tree –Priority Queue and Binary Heap –B-Tree For each of these data structures.
Data Structure II. Outline Heap Binary Search Tree Hash Table Binary Indexed Tree Segment Tree.
Data Structures for Midterm 2. C++ Data Structure Runtimes.
S. Raskhodnikova and A. Smith. Based on slides by C. Leiserson and E. Demaine. 1 Adam Smith L ECTURES Priority Queues and Binary Heaps Algorithms.
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
8 January Heap Sort CSE 2011 Winter Heap Sort Consider a priority queue with n items implemented by means of a heap  the space used is.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part R3. Priority Queues.
HEAPS. Review: what are the requirements of the abstract data type: priority queue? Quick removal of item with highest priority (highest or lowest key.
Interval S = [3,10]  {x | 3 ≤ x ≤ 10} Closed segment S = (3,10)  {x | 3 < x < 10} Opened segment S = [3,3]  {3} Point.
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
CompSci 100e 8.1 Scoreboard l What else might we want to do with a data structure? AlgorithmInsertionDeletionSearch Unsorted Vector/array Sorted vector/array.
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
Week 13 - Wednesday.  What did we talk about last time?  NP-completeness.
1 the BSTree class  BSTreeNode has same structure as binary tree nodes  elements stored in a BSTree are a key- value pair  must be a class (or a struct)
1 Const-time Search & Linear-time Sorting Shi-qing Xin & Guo-jin Wang
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.
Top 50 Data Structures Interview Questions
AN ON-CHIP IP ADDRESS LOOKUP ALGORITHM
Dynamic Dictionaries Primary Operations: Additional operations:
Priority Queues Linked-list Insert Æ Æ head head
Sorting.
Data Structures & Algorithms Priority Queues & HeapSort
Heap Sort CSE 2011 Winter January 2019.
Topic 5: Heap data structure heap sort Priority queue
Presentation transcript:

Engineering a Sorted List Data Structure for 32 Bit Keys Roman Dementiev Lutz Kettner Jens Mehnert Peter Sanders MPI für Informatik, Saarbrücken

2 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Introduction The power of integer keys helps in – Sorting (radix MSB,LSB) – Priority queues (radix heaps) – Static search trees – Dictionaries (hash tables) Faster both in theory and practice What about dynamic search data structures?

3 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Motivation van Emde Boas (vEB) search trees [ van Emde Boas77,MehlhornNaeher90 ]: Small K, large n → vEB are faster ? NO, their direct implementations are 2-8 times slower than comp. based trees [ Wenzel92,here ] Here: a tuned vEB data structure that outperforms comp. based implementations operationcomparison basedvan Emde Boas insert, delete, searchO(log n)O(log K) range queryO(c + log n)O(c + log K) n – number of elements K – bit width of keys c – size of the output

4 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Direct vEB Implementation vEB tree maintains set Recursive definition: – |M|=1 or K=1: store directly, – otherwise let K’ = K/2: store minM,maxM, top: store (top recursion) bot i : store (bottom recursion) use hash table K’ bit vEB top hash table K’ bit vEB bot i

5 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Improvement 1 Replace top data structure with a bit pattern hierarchy K’ bit vEB top hash table K’ bit vEB bot i    0    … … … … … … …… …

6 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Improvement 2 Break recursion when K=8 3 levels max    0    … … … … … … …… … hash table Level 1 – root Bits   … … … … hash table   … … … … Level 2 Bits 15-8 Level 2 Bits 15-8 Level 3 Bits 7-0   … … … … hash table single elements K’ bit vEB bot i

7 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Improvement 3 Replace root hash table with an array   0  … … … … … … …… … Level 1 – root Bits   … … … … hash table   … … … … Level 2 Bits 15-8 Level 2 Bits 15-8 Level 3 Bits 7-0   … … … … hash table single elements hash table array …

8 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Range Query Support Link elements   0  … … … … … … …… … Level 1 – root Bits   … … … … hash table   … … … … Level 2 Bits 15-8 Level 2 Bits 15-8 Level 3 Bits 7-0   … … … … hash table array …

9 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Example: Locate Operation return handle of N Function locate(y:N):ElementHandle if y > maxM then return  // no larger element i := y[16..31]// index into root table top if top[i]=null or y>maxM i then return minM top.locate(i) // look in the next L2 table if M i ={x} then return x// single element case j := y[8..15]// key for L2 table at M i if r i [j]=null or y > maxM ij then return minM i,top(i).locate(j) // look in the next L3 table if M ij ={x} then return x// single element case return r ij [top ij.locate(y[0..7])]// L3 table access  At most 9 comparisons for any input sizes

10 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Locate Performance

11 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Construction

12 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Deletion

13 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Hard Inputs

14 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04) Conclusions and Future Work Integer search trees can outperform comp. based search data struct. Future work: – Support multi-set functionality – Other key lengths (up to 38 bits) – Reduce space consumption – Find real inputs – Port it to the LEDA library