1 / 16

Van Emde Boaz Tries (The presentation follows Willard’s fast tries)

Van Emde Boaz Tries (The presentation follows Willard’s fast tries). RAM model. We have integers in the input Each integer ≤ U A computer work can store log(U) bits. Suppose we want to solve the dictionary problem: Insert(x), delete(x), find(x). Hashing. Perfect hashing.

iago
Download Presentation

Van Emde Boaz Tries (The presentation follows Willard’s fast tries)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Van Emde Boaz Tries(The presentation follows Willard’s fast tries)

  2. RAM model • We have integers in the input • Each integer ≤ U • A computer work can store log(U) bits Suppose we want to solve the dictionary problem: Insert(x), delete(x), find(x) Hashing

  3. Perfect hashing Build an O(m) table in (randomized) O(m) time Table stores m keys so that find(x) takes O(1) time Dynamic perfect hashing: Can also insert(x) and delete(x) in O(1) time (amortized expected)

  4. The successor problem In addition to find(x), insert(x), delete(x) We have successor(x) and predecessor(x)

  5. Trie 0 1 1101 0000 0011 1000 1001 Depth is log(U) and we have m leaves Can do all operations in O(log(U))

  6. Willard’s trie 0, 00, 000, 0000, 001, 0011, 1, 10, 100, 1000, ……. 0 1 1101 0000 0011 1000 1001 Store all prefixes of the keys in a hash table

  7. 0, 00, 000, 0000, 001, 0011, 1, 10, 100, 1000, ……. 0 1 1101 0000 0011 1000 1001 1100 Find(x): We can find the longest prefix of x in the trie by a binary search

  8. 0, 00, 000, 0000, 001, 0011, 1, 10, 100, 1000, ……. 0 1 1101 0000 0011 1000 1001 1100

  9. 0, 00, 000, 0000, 001, 0011, 1, 10, 100, 1000, ……. 0 1 1101 0000 0011 1000 1001 1100 Now if each node knows the minimum and the maximum in its subtree, we have either the successor or the predecessor

  10. 0, 00, 000, 0000, 001, 0011, 1, 10, 100, 1000, ……. 0 1 1101 0000 0011 1000 1001 1100 To have them both we doubly link the items

  11. Summary So we can search in O(loglogU) time Remaining problems … Space is not linear its O(nlog(U)) ! Updates take O(log(U)) time

  12. Partition the items into groups of size O(logU) each Maintain the minimum of each group in a trie as before 0100 0000 1001

  13. 0 1 0100 0000 1001 Use a binary search tree to represent each group

  14. 0 1 0100 0000 1001

  15. Summary Now space is linear Search still takes O(loglogU) time To insert or delete work within subtree -- This takes O(loglogU) time If a subtree get too large split it and insert a new item into the trie. This would take O(logU) but we peform it once for O(logU) insertions

  16. Summary (Cont) Delete is similar: We work within a set, when a set gets too small we merge it with its neighbor

More Related