Priority Queues. Sanders: Algorithm Engineering 12. Juni Maintain set M of Elements with Keys. Insert: DeleteMin:
|
|
- Fay Linda Daniel
- 5 years ago
- Views:
Transcription
1 Sanders: Algorithm Engineering 12. Juni Priority Queues Maintain set M of Elements with Keys Insert: DeleteMin: Applications (no additional operations): Multi-way Merging Greedy Algorithms (e.g., machine scheduling) Discrete event simulation Branch-and-Bound Building long runs Time forward processing (small) (small medium) (medium large) (large) (large) (huge)
2 Sanders: Algorithm Engineering 12. Juni Binary Heaps best comparison based flat memory algorithm + On average constant time for insertion + On average logn+o (1) key comparisons per delete-min using the bottom-up heuristics [Wegener 93]. 2log(n/M) block accesses per delete-min M Cache
3 Sanders: Algorithm Engineering 12. Juni Bottom Up Heuristics delete Min O(1) compare swap 7 9 move sift down hole log(n) Factor two faster than naive implementation sift up O(1) average
4 Sanders: Algorithm Engineering 12. Juni Der Wettbewerber fit gemacht: int i=1, m=2, t = a[1]; m += (m!= n && a[m] > a[m + 1]); if (t > a[m]) { do { a[i] = a[m]; i = m; m = 2*i; if (m > n) break; m += (m!= n && a[m] > a[m + 1]); } while (t > a[m]); a[i] = t;} Keine signifikanten Leistungsunterschiede auf meiner Maschine (heapsort von random integers)
5 Sanders: Algorithm Engineering 12. Juni Vergleich Speicherzugriffe: O (1) weniger als top down O (log n) worst case. bei effizienter Implementierung Elementvergleiche: log n weniger für bottom up (average case) aber die sind leicht vorhersagbar Aufgabe: siftdown mit worst case logn+o (loglogn) Elementvergleichen
6 Sanders: Algorithm Engineering 12. Juni Heapkonstruktion Procedure buildheapbackwards for i := n/2 downto 1 do siftdown(i) Procedure buildheaprecursive(i : N) if 4i n then buildheaprecursive(2i) buildheaprecursive(2i + 1) siftdown(i) Rekursive Funktion für große Eingaben 2 schneller! (Rekursion abrollen für 2 unterste Ebenen) Aufgabe: Erklärung
7 Sanders: Algorithm Engineering 12. Juni Medium Size Queues (km M 2 /B Insertions) k m sorted sequences k merge tournament tree data structure buffer m m insertion buffer Insert: Initially into insertion buffer. Overflow sort; merge with deletion buffer; write out largest elements. Delete-Min: Take minimum of insertion and deletion buffer. Refill deletion buffer if necessary.
8 Sanders: Algorithm Engineering 12. Juni Large Queues [Sanders 00] external swapped cached group 2 group 3 group 1 k k m k m k k k m k merge T 1 k merge T2 k merge T3 group group group buffer 1 m buffer 2 m buffer 3 m R merge deletion buffer m m insertion buffer insert: group full merge group; shift into next group. merge invalid group buffers and move them into group 1. Delete-Min: Refill. m m. nothing else
9 Sanders: Algorithm Engineering 12. Juni Example Merge insertion buffer, deletion buffer, and leftmost group buffer insert( 3) k j f v s r q l i u n m g c w tp o h e x k j g f v s r q l i u n m c w tp o h e d b d b b b a x a 3
10 Sanders: Algorithm Engineering 12. Juni Example Merge group 1 e x k j g f v s r q l i u n m c w tp o h e x k j g f v s r q l i u n m c w tp o h d b b d b b a 3 a 3
11 Sanders: Algorithm Engineering 12. Juni Example Merge group 2 e x k j g f v s r q l i u n m c w tp o h e x k j g f m n o p q l r i s w c h t u v d b b d b b a 3 a 3
12 Sanders: Algorithm Engineering 12. Juni Example Merge group buffers e x k j g f m n o p q l r i s w c h t u v e x d b b k j g f m n o p q l r i s w c h t u v d b b a 3 a 3
13 Sanders: Algorithm Engineering 12. Juni Example DeleteMin 3; DeleteMin a; e x d b b k j g f m n o p q l r i s w c h t u v e x d b b k j g f m n o p q l r i s w c h t u v a 3
14 Sanders: Algorithm Engineering 12. Juni Example DeleteMin b e x d b b k j g f m n o p q l r i s w c h t u v e x d k j m n o p q l r i s w t u v b g f h c
15 Sanders: Algorithm Engineering 12. Juni Analysis I insertions, buffer sizes m = Θ(M) merging degree k = Θ(M/B) block accesses: sort(i)+ small terms key comparisons: I logi + small terms (on average) W W R W R W R R R R W R Other (similar, earlier) [Arge 95, Brodal-Katajainen 98, Brengel et al. 99, Fadel et al. 97] data structures spend a factor 3 more I/Os to replace I by queue size.
16 Sanders: Algorithm Engineering 12. Juni Implementation Details Fast routines for 2 4 way merging keeping smallest elements in registers Use sentinels to avoid special case treatments (empty sequences,... ) Currently heap sort for sorting the insertion buffer k M/B: multiple levels, limited associativity, TLB
17 Sanders: Algorithm Engineering 12. Juni Experiments Keys: random 32 bit integers Associated information: 32 dummy bits Deletion buffer size: 32 Group buffer size: 256 Merging degree k: 128 Near optimal : performance on all machines tried! Compiler flags: Highly optimizing, nothing advanced Operation Sequence: (Insert-DeleteMin-Insert) N (DeleteMin-Insert-DeleteMin) N Near optimal performance on all machines tried!
18 Sanders: Algorithm Engineering 12. Juni MIPS R10000, 180 MHz (T(deleteMin) + T(insert))/log N [ns] bottom up binary heap bottom up aligned 4-ary heap sequence heap N
19 Sanders: Algorithm Engineering 12. Juni Ultra-SparcIIi, 300 MHz (T(deleteMin) + T(insert))/log N [ns] bottom up binary heap bottom up aligned 4-ary heap sequence heap N
20 Sanders: Algorithm Engineering 12. Juni Alpha-21164, 533 MHz (T(deleteMin) + T(insert))/log N [ns] bottom up binary heap bottom up aligned 4-ary heap sequence heap N
21 Sanders: Algorithm Engineering 12. Juni Pentium II, 300 MHz (T(deleteMin) + T(insert))/log N [ns] bottom up binary heap bottom up aligned 4-ary heap sequence heap N
22 Sanders: Algorithm Engineering 12. Juni (insert (deletemin insert) s ) N (deletemin (insert deletemin) s ) N (T(deleteMin) + T(insert))/log N [ns] s=0, binary heap s=0, 4-ary heap s=0 s=1 s=4 s= N
23 Sanders: Algorithm Engineering 12. Juni Methodological Lessons If you want to compare small constant factors in execution time: Reproducability demands publication of source codes (4-ary heaps, old study in Pascal) Highly tuned codes in particular for the competitors (binary heaps have factor 2 between good and naive implementation). How do you compare two mediocre implementations? Careful choice/description of inputs Use multiple different hardware platforms Augment with theory (e.g., comparisons, data dependencies, cache faults, locality effects... )
24 Sanders: Algorithm Engineering 12. Juni Open Problems Integrate into STL Dependence on size rather than number of insertions Parallel disks Space efficient implementation Multi-level cache aware or cache-oblivious variants
25 Sanders: Algorithm Engineering 12. Juni Adressable Priority Queues Procedure build({e 1,...,e n }) M:= {e 1,...,e n } Function size return M Procedure insert(e) M:= M {e} Function min return minm Function deletemin e:= min M; M:= M \ {e}; return e Function remove(h : Handle) e:= h; M:= M \ {e}; return e Procedure decreasekey(h : Handle,k : Key) assert key(h) k; Procedure merge(m ) M:= M M key(h):= k
26 Sanders: Algorithm Engineering 12. Juni Quick-Heaps Idea: Partition M into subsets M 1,...,M k Invariant: 1 i < j k,e i M i,e j M j : e i e j M i is approximately growing geometrically with i
27 Sanders: Algorithm Engineering 12. Juni Quick-Heaps Insert Procedure insert(e) for i := k downto 1 while e < minm i do ;// define minm 0 = if i = 0 then i:= 1; minm 1 := e M i := M i {e} decreasekey: similar
28 Sanders: Algorithm Engineering 12. Juni Quick-Heaps deletemin Procedure deletemin e:= minm 1 M 1 := M 1 \ {e} if M 1 = /0 then (recursively) partition M 2 and renumber to reestablish invariant return e
29 Sanders: Algorithm Engineering 12. Juni Quick-Heaps Analysis Paredes: average case complexity O (log n) Experiments: with very favorable constant factors. Open Problem: Make fit for worst case inputs. O (1) expected cost for decreasekey? Idea: active rebalancing
30 Sanders: Algorithm Engineering 12. Juni Heap Ordered Forest Basic Data Structure A forest of heap-ordered trees minptr d a e g f c b h i
31 Sanders: Algorithm Engineering 12. Juni Manipulating Forests Cut: a b a<b a Link: b
32 Sanders: Algorithm Engineering 12. Juni Pairing Heaps Procedure insertitem(h : Handle) newtree(h) Procedure newtree(h : Handle) forest:= forest {h} if e < min then minptr:= h
33 Sanders: Algorithm Engineering 12. Juni Pairing Heaps Procedure decreasekey(h : Handle,k : Key) key(h):= k if h is not a root then cut(h)
34 Sanders: Algorithm Engineering 12. Juni Pairing Heaps Function deletemin : Handle m:= minptr forest:= forest \ {m} foreach child h of m do newtree(h) Perform a pairwise link of the tree roots in forest return m
35 Sanders: Algorithm Engineering 12. Juni Pairing Heaps Procedure merge(o : AdressablePQ) if minptr > o.minptr then minptr:= o.minptr forest:= forest o.forest o.forest:= /0
36 Sanders: Algorithm Engineering 12. Juni Fibonacci Heaps (A sample from the Zoo) Ranks: initially zero, increases for root of a link Union by rank: Only link roots of equal rank Mark nodes that lost a child Cascading cuts: cut marked nodes (i.e., lost two childs) Amortized complexity: O (log n) for deletemin O (1) for all other operations
37 Sanders: Algorithm Engineering 12. Juni Representing the Tree Items parent Fibonacci Heap left sibling data rank mark right sibling one child Pairing Heap left sibling or parent data right sibling one child
38 Sanders: Algorithm Engineering 12. Juni Addressable Priority Queues: Todo No recent comparison of efficient implementations No tight analysis of pairing heaps No implementation of compromises, e.g., thin heaps [Kaplan Tarjan 99] (three pointers, no mark, slightly more complicated balancing) No implementation of worst case efficient variants Study implementation tricks: two pointers per item? sentinels,... (Almost) nothing known for memory hierarchies
39 Sanders: Algorithm Engineering 12. Juni van Emde-Boas Search Trees Store set M of K = 2 k -bit integers. later: associated information K = 1 or M = 1: store directly K := K/2 { } M i := x mod 2 K : x div 2 K = i root points to nonempty M i -s top t = {i : M i /0} insert, delete, search ino (logk) time K bit veb top hash table K bit veb bot i
40 Sanders: Algorithm Engineering 12. Juni Comparison with Comparison Based Search Trees Ideally: logn loglogn Problems: Many special case tests High space consumption Time for random locate [ns] 1000 orig-stree LEDA-STree STL map (2,16)-tree n
41 Sanders: Algorithm Engineering 12. Juni Efficient 32 bit Implementation top 3 layers of bit arrays 0 63 K bit veb top hash table hash table K bit veb bot i K bit veb bot i
42 Sanders: Algorithm Engineering 12. Juni Layers of Bit Arrays t 1 [i] = 1 iff M i /0 t 2 [i] = t 1 [32i] t 1 [32i+1] t 1 [32i+31] t 3 [i] = t 2 [32i] t 2 [32i+1] t 2 [32i+31]
43 Sanders: Algorithm Engineering 12. Juni Efficient 32 bit Implementation Break recursion after 3 layers Level 1 root hash table hash table Bits Level 2 Bits 15-8 K bit veb bot i Level 2 Bits 15-8 hash table hash table Level 3 Bits 7-0 hash table
44 Sanders: Algorithm Engineering 12. Juni Efficient 32 bit Implementation root hash table root array hash table Level 1 root Bits array Level 1 root Bits Level 2 Bits 15-8 Level 2 Bits 15-8 Level 2 Bits 15-8 hash table Level 2 Bits 15-8 hash table hash table Level 3 Bits 7-0 hash table Level 3 Bits 7-0 hash table hash table
45 Sanders: Algorithm Engineering 12. Juni Efficient 32 bit Implementation Sorted doubly linked lists for associated information and range queries array Level 1 root Bits array Level 1 root Bits Level 2 Bits 15-8 Level 2 Bits 15-8 Level 2 Bits 15-8 hash table Level 2 Bits 15-8 hash table hash table Level 3 Bits 7-0 hash table hash table Level 3 Bits 7-0 hash table
46 Sanders: Algorithm Engineering 12. Juni Example v v t 3 t 2 M ={1,11,111,1111,111111} 4095 root top t root t 2 0 t v hash M ={1,11,111,1111} L2 t 2 00 t v hash M 04 ={1111} M 00 ={1,11,111} M 1 ={111111} L Element List
47 Sanders: Algorithm Engineering 12. Juni Locate High Level //return handle of minx M : y x Function locate(y : N) : ElementHandle if y > maxm then return i := y[16..31] // Level 1 if r[i] = nil y > maxm i then return minm t 1.locate(i) if M i = {x} then return x j := y[8..15] // Level 2 if r i [ j] = nil y > maxm i j then return minm i,t 1 i.locate( j) if M i j = {x} then return x return r i j [ti 1 j.locate(y[0..7])] // Level 3
48 Sanders: Algorithm Engineering 12. Juni Locate in Bit Arrays //find the smallest j i such that t k [ j] = 1 Method locate(i) for a bit array t k consisting of n bit words //n = 32 for t 1, t 2, ti 1, t1 i j ; n = 64 for t3 ; n = 8 for ti 2, t2 i j assert some bit in t k to the right of i is nonzero j := i div n // which word? a := t k [n j..n j+ n 1] set a[(i mod n)+1..n 1] to zero // n 1 i mod n 0 if a = 0 then j := t k+1.locate( j) a := t k [n j..n j+ n 1] return n j+ msbpos(a) // e.g. floating point conversion
49 Sanders: Algorithm Engineering 12. Juni Random Locate Time for locate [ns] orig-stree LEDA-STree STL map (2,16)-tree STree n
50 Sanders: Algorithm Engineering 12. Juni Random Insert Time for insert [ns] orig-stree 500 LEDA-STree STL map (2,16)-tree STree n
51 Sanders: Algorithm Engineering 12. Juni Delete Random Elements Time for delete [ns] orig-stree LEDA-STree 500 STL map (2,16)-tree STree n
52 Sanders: Algorithm Engineering 12. Juni Open Problems Measurement for worst case inputs Measure Performance for realistic inputs IP lookup etc. Best first heuristics like, e.g., bin packing More space efficient implementation (A few) more bits
53 Sanders: Algorithm Engineering 12. Juni Hashing to hash to bring into complete disorder paradoxically, this helps us to find things more easily! store set M Element. key(e) is unique for e M. support dictionary operations in O (1) time: M.insert(e : Element): M := M {e} M.remove(k : Key): M := M \ {e}, e = k M.find(k : Key): return e M with e = k; if none present (Convention: key is implicit), e.g. e = k iff key(e) = k)
54 Sanders: Algorithm Engineering 12. Juni An (Over)optimistic approach A (perfect) hash function h h maps elements of M to unique entries of table t[0..m 1], i.e., t[h(key(e))] = e M t
55 Sanders: Algorithm Engineering 12. Juni Collisions perfect hash functions are difficult to obtain h M t Example: Birthday Paradoxon
56 Sanders: Algorithm Engineering 12. Juni Collision Resolution for example by closed hashing entries: elements sequences of elements k M h t[h(k)] t < > < > <> <> <> < > <> <> < > <> <> <>
57 Sanders: Algorithm Engineering 12. Juni Hashing with Chaining Implement sequences in closed hashing by singly linked lists insert(e): Insert e at the beginning of t[h(e)]. constant time remove(k): Scan through t[h(k)]. If an element e with h(e) = k is encountered, remove it and return. find(k) : Scan through t[h(k)]. If an element e with h(e) = k is encountered, return it. Otherwise, return. O ( M ) worst case time for remove and find k M h t[h(k)] t < > < > <> <> <> < > <> <> < > <> <> <>
58 Sanders: Algorithm Engineering 12. Juni A Review of Probability s 1 s 2 s 3 binary search? s s 4 5 s 6 s 7 buckets sample space Ω events: subsets of Ω p x =probability of x Ω Example from hashing random hash functions{0..m 1} Key E 42 = {h Ω : h(4) = h(2)} uniform distr. p h = m Key P[E ] = x E p x P[E 42 ] = m 1 random variable X 0 : Ω R X = {e M : h(e) = 0}.
59 Sanders: Algorithm Engineering 12. Juni expectation E[X 0 ] = y Ω p y X(y) Linearity of Expectation: E[X +Y] = E[X]+E[Y] E[X] = M m (*) Proof of (*): Consider the 0-1 RV X e = 1 if h(e) = 0 for e M and X e = 0 else. E[X 0 ] = E[ X e ] = E[X e ] = P[X e = 1] = M 1 e M e M e M m
60 Sanders: Algorithm Engineering 12. Juni Analysis for Random Hash Functions h < > Satz 1. The expected execution time of remove(k) and find(k) iso (1) if M =O (m). M t < > <> <> <> < > <> <> < > <> <> <> t[h(k)] Proof. Constant time plus the time for scanning t[h(k)]. X := t[h(k)] = {e M : h(e) = h(k)}. Consider the 0-1 RV X e = 1 if h(e) = h(k) for e M and X e = 0 else. E[X] = E[ X e ] = E[X e ] = P[X e = 1] = M e M e M e M m =O (1) This is independent of the input set M.
61 Sanders: Algorithm Engineering 12. Juni Universal Hashing Idea: use only certain easy hash functions Definition: U {0..m 1} Key is universal if for all x, y in Key with x y and random h U, P[h(x) = h(y)] = 1 m. Satz 2. Theorem 1 also applies to universal families of hash functions. Proof. For Ω =U we still have P[X e = 1] = 1 m. The rest is as before.
62 Sanders: Algorithm Engineering 12. Juni H Ω
63 Sanders: Algorithm Engineering 12. Juni A Simple Universal Family Assume m is prime, Key {0,...,m 1} k Satz 3. For a = (a 1,...,a k { ) {0,...,m 1} k define h a (x) = a x mod m, H = h a : a {0..m 1} k}. H is a universal family of hash functions x 1 x 2 x 3 * + * + * mod m = h a (x) a 1 a 2 a 3
64 Sanders: Algorithm Engineering 12. Juni Proof. Consider x = (x 1,...,x k ), y = (y 1,...,y k ) with x j y j count a-s with h a (x) = h a (y). For each choice of a i s, i j, exactly one a j with h a (x) = h a (y): a i x i 1 i k a j (x j y j ) a i y i ( mod m) 1 i k a i (y i x i )( mod m) i j,1 i k a j (x j y j ) 1 m k 1 ways to choose the a i with i j. m k is total number of as, i.e., a i (y i x i )( mod m) i j,1 i k
65 Sanders: Algorithm Engineering 12. Juni P[h a (x) = h a (y)] = mk 1 m k = 1 m.
66 Sanders: Algorithm Engineering 12. Juni Bit Based Universal Families Let m = 2 w, Key = {0,1} k Bit-Matrix Multiplication: H = where h M (x) = Mx (arithmetics mod 2, i.e., xor, and) Table Lookup:H [] = {h M : M {0,1} w k} { h [] (t 1,...,t b ) : t i {0..m 1} {0..w 1}} where h [] (t 1,...,t b ) ((x 0,x 1,...,x b )) = x 0 L b i=1 t i [x i ] k x x 2 x 1 a a x 0 w
67 Sanders: Algorithm Engineering 12. Juni Hashing with Linear Probing Open hashing: go back to original idea. Elements are directly stored in the table. Collisions are resolved by finding other entries. linear probing: search for next free place by scanning the table. Wrap around at the end. simple space efficient h cache efficient M t
68 Sanders: Algorithm Engineering 12. Juni The Easy Part Class BoundedLinearProbing(m,m : N; h : Key 0..m 1) t=[,..., ] : Array [0..m+m 1] of Element invariant i : t[i] : j {h(t[i])..i 1} : t[i] Procedure insert(e : Element) h for i := h(e) to while t[i] do ; assert i < m+m 1 t[i] := e Function find(k : Key) : Element for i := h(e) to while t[i] do if t[i] = k then return t[i] return M m t m
69 Sanders: Algorithm Engineering 12. Juni Remove example: t = [..., x h(z),y,z,...], remove(x) invariant i : t[i] : j {h(t[i])..i 1} : t[i] Procedure remove(k : Key) for i := h(k) to while k t[i] do if t[i] = then return //we plan for a hole at i. for j := i+1 to while t[ j] do t[i] := // Establish invariant for t[ j]. if h(t[ j]) i then t[i] := t[ j] i := j // search k // nothing to do // Overwrite removed element // move planned hole // erase freed entry
70 Sanders: Algorithm Engineering 12. Juni More Hashing Issues High probability and worst case guarantees more requirements on the hash functions Hashing as a means of load balancing in parallel systems, e.g., storage servers Different disk sizes and speeds Adding disks / replacing failed disks without much copying
71 Sanders: Algorithm Engineering 12. Juni Space Efficient Hashing with Worst Case Constant Access Time Represent a set of n elements (with associated information) using space (1+ε)n. Support operations insert, delete, lookup, (doall) efficiently. Assume a truly random hash function h
72 Sanders: Algorithm Engineering 12. Juni Related Work Uniform hashing: Expected time 1 ε h 1 h 2 h 3 Dynamic Perfect Hashing, [Dietzfelbinger et al. 94] Worst case constant time for lookup but ε is not small. Approaching the Information Theoretic Lower Bound: [Brodnik Munro 99,Raman Rao 02] Space (1 + o(1)) lower bound without associated information [Pagh 01] static case.
73 Sanders: Algorithm Engineering 12. Juni Cuckoo Hashing [Pagh Rodler 01] Table of size 2+ε. Two choices for each element. Insert moves elements; rebuild if necessary. Very fast lookup and insert. Expected constant insertion time. h 1 h 2
74 Sanders: Algorithm Engineering 12. Juni d-ary Cuckoo Hashing d choices for each element. Worst case d probes for delete and lookup. Task: maintain perfect matching h 1 in the bipartite graph (L = Elements,R = Cells,E = Choices), e.g., insert by BFS of random walk. h 2 h 3
75 Sanders: Algorithm Engineering 12. Juni Tradeoff: Space Lookup/Deletion Time Lookup and Delete: d =O ( log 1 ε) probes Insert: ( ) 1 O(log(1/ε)), (experiments) O (1/ε)? ε
76 Sanders: Algorithm Engineering 12. Juni Experiments ε * #probes for insert d=2 d=3 d=4 d= space utilization
77 Sanders: Algorithm Engineering 12. Juni Open Questions and Further Results Tight analysis of insertion Two choices with d slots each [Dietzfelbinger et al.] cache efficiency Good Implementation? Automatic rehash Always correct
Cache-Oblivious Algorithms
Cache-Oblivious Algorithms 1 Cache-Oblivious Model 2 The Unknown Machine Algorithm C program gcc Object code linux Execution Can be executed on machines with a specific class of CPUs Algorithm Java program
More informationCache-Oblivious Algorithms
Cache-Oblivious Algorithms 1 Cache-Oblivious Model 2 The Unknown Machine Algorithm C program gcc Object code linux Execution Can be executed on machines with a specific class of CPUs Algorithm Java program
More informationHashing. Martin Babka. January 12, 2011
Hashing Martin Babka January 12, 2011 Hashing Hashing, Universal hashing, Perfect hashing Input data is uniformly distributed. A dynamic set is stored. Universal hashing Randomised algorithm uniform choice
More informationInsert Sorted List Insert as the Last element (the First element?) Delete Chaining. 2 Slide courtesy of Dr. Sang-Eon Park
1617 Preview Data Structure Review COSC COSC Data Structure Review Linked Lists Stacks Queues Linked Lists Singly Linked List Doubly Linked List Typical Functions s Hash Functions Collision Resolution
More informationHash tables. Hash tables
Dictionary Definition A dictionary is a data-structure that stores a set of elements where each element has a unique key, and supports the following operations: Search(S, k) Return the element whose key
More informationHash tables. Hash tables
Dictionary Definition A dictionary is a data-structure that stores a set of elements where each element has a unique key, and supports the following operations: Search(S, k) Return the element whose key
More informationAdvanced Implementations of Tables: Balanced Search Trees and Hashing
Advanced Implementations of Tables: Balanced Search Trees and Hashing Balanced Search Trees Binary search tree operations such as insert, delete, retrieve, etc. depend on the length of the path to the
More information1 Maintaining a Dictionary
15-451/651: Design & Analysis of Algorithms February 1, 2016 Lecture #7: Hashing last changed: January 29, 2016 Hashing is a great practical tool, with an interesting and subtle theory too. In addition
More informationMotivation. Dictionaries. Direct Addressing. CSE 680 Prof. Roger Crawfis
Motivation Introduction to Algorithms Hash Tables CSE 680 Prof. Roger Crawfis Arrays provide an indirect way to access a set. Many times we need an association between two sets, or a set of keys and associated
More informationCache-Oblivious Hashing
Cache-Oblivious Hashing Zhewei Wei Hong Kong University of Science & Technology Joint work with Rasmus Pagh, Ke Yi and Qin Zhang Dictionary Problem Store a subset S of the Universe U. Lookup: Does x belong
More informationData Structures 1 NTIN066
Data Structures 1 NTIN066 Jiří Fink https://kam.mff.cuni.cz/ fink/ Department of Theoretical Computer Science and Mathematical Logic Faculty of Mathematics and Physics Charles University in Prague Winter
More informationHash Tables. Given a set of possible keys U, such that U = u and a table of m entries, a Hash function h is a
Hash Tables Given a set of possible keys U, such that U = u and a table of m entries, a Hash function h is a mapping from U to M = {1,..., m}. A collision occurs when two hashed elements have h(x) =h(y).
More informationHash tables. Hash tables
Basic Probability Theory Two events A, B are independent if Conditional probability: Pr[A B] = Pr[A] Pr[B] Pr[A B] = Pr[A B] Pr[B] The expectation of a (discrete) random variable X is E[X ] = k k Pr[X
More informationCS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 32
CS 473: Algorithms Ruta Mehta University of Illinois, Urbana-Champaign Spring 2018 Ruta (UIUC) CS473 1 Spring 2018 1 / 32 CS 473: Algorithms, Spring 2018 Universal Hashing Lecture 10 Feb 15, 2018 Most
More informationData Structures 1 NTIN066
Data Structures 1 NTIN066 Jirka Fink Department of Theoretical Computer Science and Mathematical Logic Faculty of Mathematics and Physics Charles University in Prague Winter semester 2017/18 Last change
More informationlsb(x) = Least Significant Bit?
lsb(x) = Least Significant Bit? w-1 lsb i 1 0 x 0 0 1 0 1 0 1 1 0 0 1 0 0 0 0 0 1 msb(x) in O(1) steps using 5 multiplications [M.L. Fredman, D.E. Willard, Surpassing the information-theoretic bound with
More informationINTRODUCTION TO HASHING Dr. Thomas Hicks Trinity University. Data Set - SSN's from UTSA Class
Dr. Thomas E. Hicks Data Abstractions Homework - Hashing -1 - INTRODUCTION TO HASHING Dr. Thomas Hicks Trinity University Data Set - SSN's from UTSA Class 467 13 3881 498 66 2055 450 27 3804 456 49 5261
More informationSo far we have implemented the search for a key by carefully choosing split-elements.
7.7 Hashing Dictionary: S. insert(x): Insert an element x. S. delete(x): Delete the element pointed to by x. S. search(k): Return a pointer to an element e with key[e] = k in S if it exists; otherwise
More information1 Hashing. 1.1 Perfect Hashing
1 Hashing Hashing is covered by undergraduate courses like Algo I. However, there is much more to say on this topic. Here, we focus on two selected topics: perfect hashing and cockoo hashing. In general,
More information8 Priority Queues. 8 Priority Queues. Prim s Minimum Spanning Tree Algorithm. Dijkstra s Shortest Path Algorithm
8 Priority Queues 8 Priority Queues A Priority Queue S is a dynamic set data structure that supports the following operations: S. build(x 1,..., x n ): Creates a data-structure that contains just the elements
More informationPriority queues implemented via heaps
Priority queues implemented via heaps Comp Sci 1575 Data s Outline 1 2 3 Outline 1 2 3 Priority queue: most important first Recall: queue is FIFO A normal queue data structure will not implement a priority
More informationFundamental Algorithms
Chapter 5: Hash Tables, Winter 2018/19 1 Fundamental Algorithms Chapter 5: Hash Tables Jan Křetínský Winter 2018/19 Chapter 5: Hash Tables, Winter 2018/19 2 Generalised Search Problem Definition (Search
More informationLecture: Analysis of Algorithms (CS )
Lecture: Analysis of Algorithms (CS483-001) Amarda Shehu Spring 2017 1 Outline of Today s Class 2 Choosing Hash Functions Universal Universality Theorem Constructing a Set of Universal Hash Functions Perfect
More informationChapter 5 Data Structures Algorithm Theory WS 2017/18 Fabian Kuhn
Chapter 5 Data Structures Algorithm Theory WS 2017/18 Fabian Kuhn Priority Queue / Heap Stores (key,data) pairs (like dictionary) But, different set of operations: Initialize-Heap: creates new empty heap
More informationModule 1: Analyzing the Efficiency of Algorithms
Module 1: Analyzing the Efficiency of Algorithms Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu What is an Algorithm?
More informationA Linear Time Algorithm for Ordered Partition
A Linear Time Algorithm for Ordered Partition Yijie Han School of Computing and Engineering University of Missouri at Kansas City Kansas City, Missouri 64 hanyij@umkc.edu Abstract. We present a deterministic
More informationSearching, mainly via Hash tables
Data structures and algorithms Part 11 Searching, mainly via Hash tables Petr Felkel 26.1.2007 Topics Searching Hashing Hash function Resolving collisions Hashing with chaining Open addressing Linear Probing
More informationCSE548, AMS542: Analysis of Algorithms, Fall 2017 Date: Oct 26. Homework #2. ( Due: Nov 8 )
CSE548, AMS542: Analysis of Algorithms, Fall 2017 Date: Oct 26 Homework #2 ( Due: Nov 8 ) Task 1. [ 80 Points ] Average Case Analysis of Median-of-3 Quicksort Consider the median-of-3 quicksort algorithm
More informationRandomized Load Balancing:The Power of 2 Choices
Randomized Load Balancing: The Power of 2 Choices June 3, 2010 Balls and Bins Problem We have m balls that are thrown into n bins, the location of each ball chosen independently and uniformly at random
More informationInteger Sorting on the word-ram
Integer Sorting on the word-rm Uri Zwick Tel viv University May 2015 Last updated: June 30, 2015 Integer sorting Memory is composed of w-bit words. rithmetical, logical and shift operations on w-bit words
More informationReview Of Topics. Review: Induction
Review Of Topics Asymptotic notation Solving recurrences Sorting algorithms Insertion sort Merge sort Heap sort Quick sort Counting sort Radix sort Medians/order statistics Randomized algorithm Worst-case
More informationPremaster Course Algorithms 1 Chapter 3: Elementary Data Structures
Premaster Course Algorithms 1 Chapter 3: Elementary Data Structures Christian Scheideler SS 2018 23.04.2018 Chapter 3 1 Overview Basic data structures Search structures (successor searching) Dictionaries
More informationcompare to comparison and pointer based sorting, binary trees
Admin Hashing Dictionaries Model Operations. makeset, insert, delete, find keys are integers in M = {1,..., m} (so assume machine word size, or unit time, is log m) can store in array of size M using power:
More informationIntroduction to Hashtables
Introduction to HashTables Boise State University March 5th 2015 Hash Tables: What Problem Do They Solve What Problem Do They Solve? Why not use arrays for everything? 1 Arrays can be very wasteful: Example
More information25. Minimum Spanning Trees
695 25. Minimum Spanning Trees Motivation, Greedy, Algorithm Kruskal, General Rules, ADT Union-Find, Algorithm Jarnik, Prim, Dijkstra, Fibonacci Heaps [Ottman/Widmayer, Kap. 9.6, 6.2, 6.1, Cormen et al,
More information25. Minimum Spanning Trees
Problem Given: Undirected, weighted, connected graph G = (V, E, c). 5. Minimum Spanning Trees Motivation, Greedy, Algorithm Kruskal, General Rules, ADT Union-Find, Algorithm Jarnik, Prim, Dijkstra, Fibonacci
More informationCollision. Kuan-Yu Chen ( 陳冠宇 ) TR-212, NTUST
Collision Kuan-Yu Chen ( 陳冠宇 ) 2018/12/17 @ TR-212, NTUST Review Hash table is a data structure in which keys are mapped to array positions by a hash function When two or more keys map to the same memory
More informationA Lecture on Hashing. Aram-Alexandre Pooladian, Alexander Iannantuono March 22, Hashing. Direct Addressing. Operations - Simple
A Lecture on Hashing Aram-Alexandre Pooladian, Alexander Iannantuono March 22, 217 This is the scribing of a lecture given by Luc Devroye on the 17th of March 217 for Honours Algorithms and Data Structures
More informationSorting. Chapter 11. CSE 2011 Prof. J. Elder Last Updated: :11 AM
Sorting Chapter 11-1 - Sorting Ø We have seen the advantage of sorted data representations for a number of applications q Sparse vectors q Maps q Dictionaries Ø Here we consider the problem of how to efficiently
More informationInsertion Sort. We take the first element: 34 is sorted
Insertion Sort Idea: by Ex Given the following sequence to be sorted 34 8 64 51 32 21 When the elements 1, p are sorted, then the next element, p+1 is inserted within these to the right place after some
More informationWeak Heaps and Friends: Recent Developments
Weak Heaps and Friends: Recent Developments Stefan Edelkamp 1, Amr Elmasry 2, Jyrki Katajainen 3,4, 1) University of Bremen 2) Alexandria University 3) University of Copenhagen 4) Jyrki Katajainen and
More informationLecture 4 Thursday Sep 11, 2014
CS 224: Advanced Algorithms Fall 2014 Lecture 4 Thursday Sep 11, 2014 Prof. Jelani Nelson Scribe: Marco Gentili 1 Overview Today we re going to talk about: 1. linear probing (show with 5-wise independence)
More informationAlgorithms lecture notes 1. Hashing, and Universal Hash functions
Algorithms lecture notes 1 Hashing, and Universal Hash functions Algorithms lecture notes 2 Can we maintain a dictionary with O(1) per operation? Not in the deterministic sense. But in expectation, yes.
More informationCS 591, Lecture 6 Data Analytics: Theory and Applications Boston University
CS 591, Lecture 6 Data Analytics: Theory and Applications Boston University Babis Tsourakakis February 8th, 2017 Universal hash family Notation: Universe U = {0,..., u 1}, index space M = {0,..., m 1},
More informationCS Data Structures and Algorithm Analysis
CS 483 - Data Structures and Algorithm Analysis Lecture VII: Chapter 6, part 2 R. Paul Wiegand George Mason University, Department of Computer Science March 22, 2006 Outline 1 Balanced Trees 2 Heaps &
More informationFundamental Algorithms
Chapter 2: Sorting, Winter 2018/19 1 Fundamental Algorithms Chapter 2: Sorting Jan Křetínský Winter 2018/19 Chapter 2: Sorting, Winter 2018/19 2 Part I Simple Sorts Chapter 2: Sorting, Winter 2018/19 3
More information1 Introduction A priority queue is a data structure that maintains a set of elements and supports operations insert, decrease-key, and extract-min. Pr
Buckets, Heaps, Lists, and Monotone Priority Queues Boris V. Cherkassky Central Econ. and Math. Inst. Krasikova St. 32 117418, Moscow, Russia cher@cemi.msk.su Craig Silverstein y Computer Science Department
More informationFundamental Algorithms
Fundamental Algorithms Chapter 2: Sorting Harald Räcke Winter 2015/16 Chapter 2: Sorting, Winter 2015/16 1 Part I Simple Sorts Chapter 2: Sorting, Winter 2015/16 2 The Sorting Problem Definition Sorting
More informationSearch Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :52 AM
Search Trees Chapter 1 < 6 2 > 1 4 = 8 9-1 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 2 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 3 - Binary Search Trees Ø A binary search
More informationA Tight Lower Bound for Dynamic Membership in the External Memory Model
A Tight Lower Bound for Dynamic Membership in the External Memory Model Elad Verbin ITCS, Tsinghua University Qin Zhang Hong Kong University of Science & Technology April 2010 1-1 The computational model
More informationCPSC 320 Sample Final Examination December 2013
CPSC 320 Sample Final Examination December 2013 [10] 1. Answer each of the following questions with true or false. Give a short justification for each of your answers. [5] a. 6 n O(5 n ) lim n + This is
More informationAdvanced Data Structures
Simon Gog gog@kit.edu - Simon Gog: KIT The Research University in the Helmholtz Association www.kit.edu Predecessor data structures We want to support the following operations on a set of integers from
More informationHeaps and Priority Queues
Heaps and Priority Queues Motivation Situations where one has to choose the next most important from a collection. Examples: patients in an emergency room, scheduling programs in a multi-tasking OS. Need
More informationOptimal Color Range Reporting in One Dimension
Optimal Color Range Reporting in One Dimension Yakov Nekrich 1 and Jeffrey Scott Vitter 1 The University of Kansas. yakov.nekrich@googlemail.com, jsv@ku.edu Abstract. Color (or categorical) range reporting
More information2-INF-237 Vybrané partie z dátových štruktúr 2-INF-237 Selected Topics in Data Structures
2-INF-237 Vybrané partie z dátových štruktúr 2-INF-237 Selected Topics in Data Structures Instructor: Broňa Brejová E-mail: brejova@fmph.uniba.sk Office: M163 Course webpage: http://compbio.fmph.uniba.sk/vyuka/vpds/
More informationData Structures and Algorithms
Data Structures and Algorithms Spring 2017-2018 Outline 1 Sorting Algorithms (contd.) Outline Sorting Algorithms (contd.) 1 Sorting Algorithms (contd.) Analysis of Quicksort Time to sort array of length
More informationProblem 1: (Chernoff Bounds via Negative Dependence - from MU Ex 5.15)
Problem 1: Chernoff Bounds via Negative Dependence - from MU Ex 5.15) While deriving lower bounds on the load of the maximum loaded bin when n balls are thrown in n bins, we saw the use of negative dependence.
More informationIntroduction to Hash Tables
Introduction to Hash Tables Hash Functions A hash table represents a simple but efficient way of storing, finding, and removing elements. In general, a hash table is represented by an array of cells. In
More informationData Structures and Algorithms " Search Trees!!
Data Structures and Algorithms " Search Trees!! Outline" Binary Search Trees! AVL Trees! (2,4) Trees! 2 Binary Search Trees! "! < 6 2 > 1 4 = 8 9 Ordered Dictionaries" Keys are assumed to come from a total
More informationLecture Lecture 3 Tuesday Sep 09, 2014
CS 4: Advanced Algorithms Fall 04 Lecture Lecture 3 Tuesday Sep 09, 04 Prof. Jelani Nelson Scribe: Thibaut Horel Overview In the previous lecture we finished covering data structures for the predecessor
More informationPart IA Algorithms Notes
Part IA Algorithms Notes 1 Sorting 1.1 Insertion Sort 1 d e f i n s e r t i o n S o r t ( a ) : 2 f o r i from 1 i n c l u d e d to l e n ( a ) excluded : 3 4 j = i 1 5 w h i l e j >= 0 and a [ i ] > a
More informationProblem. Maintain the above set so as to support certain
Randomized Data Structures Roussos Ioannis Fundamental Data-structuring Problem Collection {S 1,S 2, } of sets of items. Each item i is an arbitrary record, indexed by a key k(i). Each k(i) is drawn from
More information1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is:
CS 24 Section #8 Hashing, Skip Lists 3/20/7 Probability Review Expectation (weighted average): the expectation of a random quantity X is: x= x P (X = x) For each value x that X can take on, we look at
More informationQuiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts)
Introduction to Algorithms October 13, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Quiz 1 Solutions Quiz 1 Solutions Problem 1. We
More informationFibonacci Heaps These lecture slides are adapted from CLRS, Chapter 20.
Fibonacci Heaps These lecture slides are adapted from CLRS, Chapter 20. Princeton University COS 4 Theory of Algorithms Spring 2002 Kevin Wayne Priority Queues Operation mae-heap insert find- delete- union
More informationData Structures and Algorithms Chapter 2
1 Data Structures and Algorithms Chapter 2 Werner Nutt 2 Acknowledgments The course follows the book Introduction to Algorithms, by Cormen, Leiserson, Rivest and Stein, MIT Press [CLRST]. Many examples
More informationNotes on Logarithmic Lower Bounds in the Cell Probe Model
Notes on Logarithmic Lower Bounds in the Cell Probe Model Kevin Zatloukal November 10, 2010 1 Overview Paper is by Mihai Pâtraşcu and Erik Demaine. Both were at MIT at the time. (Mihai is now at AT&T Labs.)
More informationAlgorithms for Data Science
Algorithms for Data Science CSOR W4246 Eleni Drinea Computer Science Department Columbia University Tuesday, December 1, 2015 Outline 1 Recap Balls and bins 2 On randomized algorithms 3 Saving space: hashing-based
More informationFIBONACCI HEAPS. preliminaries insert extract the minimum decrease key bounding the rank meld and delete. Copyright 2013 Kevin Wayne
FIBONACCI HEAPS preliminaries insert extract the minimum decrease key bounding the rank meld and delete Copyright 2013 Kevin Wayne http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated on Sep
More informationDictionary: an abstract data type
2-3 Trees 1 Dictionary: an abstract data type A container that maps keys to values Dictionary operations Insert Search Delete Several possible implementations Balanced search trees Hash tables 2 2-3 trees
More informationENS Lyon Camp. Day 2. Basic group. Cartesian Tree. 26 October
ENS Lyon Camp. Day 2. Basic group. Cartesian Tree. 26 October Contents 1 Cartesian Tree. Definition. 1 2 Cartesian Tree. Construction 1 3 Cartesian Tree. Operations. 2 3.1 Split............................................
More informationAnalysis of Algorithms. Outline 1 Introduction Basic Definitions Ordered Trees. Fibonacci Heaps. Andres Mendez-Vazquez. October 29, Notes.
Analysis of Algorithms Fibonacci Heaps Andres Mendez-Vazquez October 29, 2015 1 / 119 Outline 1 Introduction Basic Definitions Ordered Trees 2 Binomial Trees Example 3 Fibonacci Heap Operations Fibonacci
More informationCS361 Homework #3 Solutions
CS6 Homework # Solutions. Suppose I have a hash table with 5 locations. I would like to know how many items I can store in it before it becomes fairly likely that I have a collision, i.e., that two items
More informationFinger Search in the Implicit Model
Finger Search in the Implicit Model Gerth Stølting Brodal, Jesper Sindahl Nielsen, Jakob Truelsen MADALGO, Department o Computer Science, Aarhus University, Denmark. {gerth,jasn,jakobt}@madalgo.au.dk Abstract.
More informationData Structures and Algorithm. Xiaoqing Zheng
Data Structures and Algorithm Xiaoqing Zheng zhengxq@fudan.edu.cn MULTIPOP top[s] = 6 top[s] = 2 3 2 8 5 6 5 S MULTIPOP(S, x). while not STACK-EMPTY(S) and k 0 2. do POP(S) 3. k k MULTIPOP(S, 4) Analysis
More informationBiased Quantiles. Flip Korn Graham Cormode S. Muthukrishnan
Biased Quantiles Graham Cormode cormode@bell-labs.com S. Muthukrishnan muthu@cs.rutgers.edu Flip Korn flip@research.att.com Divesh Srivastava divesh@research.att.com Quantiles Quantiles summarize data
More information12 Hash Tables Introduction Chaining. Lecture 12: Hash Tables [Fa 10]
Calvin: There! I finished our secret code! Hobbes: Let s see. Calvin: I assigned each letter a totally random number, so the code will be hard to crack. For letter A, you write 3,004,572,688. B is 28,731,569½.
More informationCS173 Running Time and Big-O. Tandy Warnow
CS173 Running Time and Big-O Tandy Warnow CS 173 Running Times and Big-O analysis Tandy Warnow Today s material We will cover: Running time analysis Review of running time analysis of Bubblesort Review
More informationBloom Filters, general theory and variants
Bloom Filters: general theory and variants G. Caravagna caravagn@cli.di.unipi.it Information Retrieval Wherever a list or set is used, and space is a consideration, a Bloom Filter should be considered.
More informationAdvanced Data Structures
Simon Gog gog@kit.edu - Simon Gog: KIT University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association www.kit.edu Predecessor data structures We want to support
More informationLecture 4: Divide and Conquer: van Emde Boas Trees
Lecture 4: Divide and Conquer: van Emde Boas Trees Series of Improved Data Structures Insert, Successor Delete Space This lecture is based on personal communication with Michael Bender, 001. Goal We want
More information? 11.5 Perfect hashing. Exercises
11.5 Perfect hashing 77 Exercises 11.4-1 Consider inserting the keys 10; ; 31; 4; 15; 8; 17; 88; 59 into a hash table of length m 11 using open addressing with the auxiliary hash function h 0.k/ k. Illustrate
More informationData Structure. Mohsen Arab. January 13, Yazd University. Mohsen Arab (Yazd University ) Data Structure January 13, / 86
Data Structure Mohsen Arab Yazd University January 13, 2015 Mohsen Arab (Yazd University ) Data Structure January 13, 2015 1 / 86 Table of Content Binary Search Tree Treaps Skip Lists Hash Tables Mohsen
More information6.854 Advanced Algorithms
6.854 Advanced Algorithms Homework Solutions Hashing Bashing. Solution:. O(log U ) for the first level and for each of the O(n) second level functions, giving a total of O(n log U ) 2. Suppose we are using
More informationCS483 Design and Analysis of Algorithms
CS483 Design and Analysis of Algorithms Lectures 2-3 Algorithms with Numbers Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments
More informationAMORTIZED ANALYSIS. binary counter multipop stack dynamic table. Lecture slides by Kevin Wayne. Last updated on 1/24/17 11:31 AM
AMORTIZED ANALYSIS binary counter multipop stack dynamic table Lecture slides by Kevin Wayne http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated on 1/24/17 11:31 AM Amortized analysis Worst-case
More informationBalanced Allocation Through Random Walk
Balanced Allocation Through Random Walk Alan Frieze Samantha Petti November 25, 2017 Abstract We consider the allocation problem in which m (1 ε)dn items are to be allocated to n bins with capacity d.
More informationAlgorithms Theory. 08 Fibonacci Heaps
Algorithms Theory 08 Fibonacci Heaps Prof. Dr. S. Albers Priority queues: operations Priority queue Q Operations: Q.initialize(): initializes an empty queue Q Q.isEmpty(): returns true iff Q is empty Q.insert(e):
More informationHashing. Data organization in main memory or disk
Hashing Data organization in main memory or disk sequential, binary trees, The location of a key depends on other keys => unnecessary key comparisons to find a key Question: find key with a single comparison
More informationFibonacci (Min-)Heap. (I draw dashed lines in place of of circular lists.) 1 / 17
Fibonacci (Min-)Heap A forest of heap-order trees (parent priority child priority). Roots in circular doubly-linked list. Pointer to minimum-priority root. Siblings in circular doubly-linked list; parent
More informationSearch Trees. EECS 2011 Prof. J. Elder Last Updated: 24 March 2015
Search Trees < 6 2 > 1 4 = 8 9-1 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 2 - Learning Outcomes Ø From this lecture, you should be able to: q Define the properties of a binary search
More informationDictionary: an abstract data type
2-3 Trees 1 Dictionary: an abstract data type A container that maps keys to values Dictionary operations Insert Search Delete Several possible implementations Balanced search trees Hash tables 2 2-3 trees
More informationAdvanced Data Structures
Simon Gog gog@kit.edu - 0 Simon Gog: KIT University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association www.kit.edu Dynamic Perfect Hashing What we want: O(1) lookup
More informationCache-Oblivious Computations: Algorithms and Experimental Evaluation
Cache-Oblivious Computations: Algorithms and Experimental Evaluation Vijaya Ramachandran Department of Computer Sciences University of Texas at Austin Dissertation work of former PhD student Dr. Rezaul
More informationFunctional Data Structures
Functional Data Structures with Isabelle/HOL Tobias Nipkow Fakultät für Informatik Technische Universität München 2017-2-3 1 Part II Functional Data Structures 2 Chapter 1 Binary Trees 3 1 Binary Trees
More information6.1 Occupancy Problem
15-859(M): Randomized Algorithms Lecturer: Anupam Gupta Topic: Occupancy Problems and Hashing Date: Sep 9 Scribe: Runting Shi 6.1 Occupancy Problem Bins and Balls Throw n balls into n bins at random. 1.
More informationQuiz 2. Due November 26th, CS525 - Advanced Database Organization Solutions
Name CWID Quiz 2 Due November 26th, 2015 CS525 - Advanced Database Organization s Please leave this empty! 1 2 3 4 5 6 7 Sum Instructions Multiple choice questions are graded in the following way: You
More informationHashing. Dictionaries Chained Hashing Universal Hashing Static Dictionaries and Perfect Hashing. Philip Bille
Hashing Dictionaries Chained Hashing Universal Hashing Static Dictionaries and Perfect Hashing Philip Bille Hashing Dictionaries Chained Hashing Universal Hashing Static Dictionaries and Perfect Hashing
More informationOnline Sorted Range Reporting and Approximating the Mode
Online Sorted Range Reporting and Approximating the Mode Mark Greve Progress Report Department of Computer Science Aarhus University Denmark January 4, 2010 Supervisor: Gerth Stølting Brodal Online Sorted
More informationHash Tables. Direct-Address Tables Hash Functions Universal Hashing Chaining Open Addressing. CS 5633 Analysis of Algorithms Chapter 11: Slide 1
Hash Tables Direct-Address Tables Hash Functions Universal Hashing Chaining Open Addressing CS 5633 Analysis of Algorithms Chapter 11: Slide 1 Direct-Address Tables 2 2 Let U = {0,...,m 1}, the set of
More information