Van Emde Boas Trees

1 / 39

# Van Emde Boas Trees - PowerPoint PPT Presentation

Van Emde Boas Trees. Elif Tosun (252a-aa) CSC 252 – Final Project. Outline . Introduction “Silly” Priority Queue Stratified Tree Structure Operations on the Stratified Tree Structure Conclusions My Contribution References. Introduction. Main problem in operations for Set Manipulation

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Van Emde Boas Trees' - glenna

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Van Emde Boas Trees

Elif Tosun (252a-aa)

CSC 252 – Final Project

Outline
• Introduction
• “Silly” Priority Queue
• Stratified Tree Structure
• Operations on the Stratified Tree Structure
• Conclusions
• My Contribution
• References
Introduction
• Main problem in operations for Set Manipulation
• Random Access (insert/delete/membership)
• Ordered Representation (predecessor/successor)
• Some data structures: binary heap, AVL trees,

2-3 trees, etc.

• Lower Bounds for a Restricted Universe
• Motivation: Enumeration Algorithms
“Silly” Priority Queue
• Structure
• n = 2k leaves, height = k
• Leaves with priorities from {1, 2,…, n}
• k-bit representation (root to leaf)
• 0, for left
• 1, for right
“Silly” PQ – Structure (Cont’d)
• Subset S  {1,..,n} Representation
• Mark leaves in S and all nodes on the paths from root to the marked leaves.
“Silly” PQ – (Cont’d)Sketches of Algorithms
• Insert(i)
• Delete(i)
• Member(i)
• Min
• Predecessor
“Silly” PQ – (Cont’d)Sketches of Algorithms
• Insert(i)
• Delete(i)
• Member(i)
• Min
• Predecessor
“Silly” PQ – (Cont’d)Sketches of Algorithms
• Insert(i)
• Delete(i)
• Member(i)
• Min
• Predecessor
“Silly” PQ – (Cont’d)Sketches of Algorithms
• Insert(i)
• Delete(i)
• Member(i)
• Min
• Predecessor
“Silly” PQ – (Cont’d)Sketches of Algorithms
• Insert(i)
• Delete(i)
• Member(i)
• Min
• Predecessor
“Silly” PQ – (Cont’d)Sketches of Algorithms
• Insert(i)
• Delete(i)
• Member(i)
• Min
• Predecessor
Improvements?
• Divide and Conquer Strategy.
• Divide the universe {1, …, n} into n^(1/2) blocks of size n^(1/2). Insert/Delete locally
• Run time recurrence:

T(n) = T(n^(1/2)) + 1

• Result : T(n) = O(loglogn)
Stratified Tree Structure
• Based on Divide and Conquer Approach

mentioned before.

• Two types of information available for each node:
• Static Information
• Dynamic Information
Static Information
• Level: Length of path from a node to its leaves
• Rank: x, for greatest divisor 2^x of the level of a node. For leaves, rank = k+1 where height= 2^k
• Position:
• Leaves: number in {1, …, n} representing the leaf
• Internal nodes:position of rightmost leaf of its lefthand son.
• Canonical Subtree of rank d (CS): Binary subtree having as a root node of rank >= d, as leaves descendants at the nearest level of rank >=d.
Static Information(Cont’d)
• Left Canonical Subtree(LCS): Includes all left hand side descendants
• Upper Canonical Subtree(UC): Subtree of rank d, having the node as a leaf.
• Lower Canonical Subtree(LC): Subtree of rank d, having the node as a root.
• Reach: LC+UC
Dynamic Information
• Internal Nodes:
• lmin: leftmost present leaf in LLC(v)
• lmax: rightmost present leaf in LLC(v)
• rmin: leftmost present leaf in RLC(v)
• rmax: rightmost present leaf in RLC(v)
• ub: +, if there exists a branchpoint on the path between the top of LC and v.

-, otherwise

Some definitions…
• Branch Point: An internal node with 2 present sons
• Active Node: A present node that has at least one dynamic field that doesn’t equal null.

Note: For some operations to be done in O(1) nodes are prevented from being active unless needed.

Properness Condition

Let v be a present internal node.

V is active there exists a branchpoint in the interior of the reach of v.

Note: a leaf is active it’s present

root is active set  null

Representation of S
• Leaves corresponding to elements of S and their ancestors are marked to be present.
• Information on which present nodes are active is computed. – using Properness Condition
• Dynamic fields of all active and non-active nodes are given their proper values.
Operations on the Stratified Tree
• Insert:Let l to be the leaf to be inserted.

If (no present leaves exists on l’s side of the tree)

insert as before

Else

compute the fathers of l(=hl) and

the present leaf p (=hp).

if no branchpoint exists on l’s side of CS

hp is present without being active.

hl is present iff hp = hl

Operations- Insert (Cont’d)

if hl is present

insert l under hp = hl

if hl is not present

insert l as a leaf to a node

above hp.

Operations – Insert (Cont’d)

If a branch point does exist on l’s side of CS

hl is present iff it’s active

if hl is active

insert leaf as a child to hl

if hl is not active

insert leaf as a child to a node

above hp

Operations on the Stratified Tree
• Delete:

Makes a leaf non-present as well as its ancestors up to the lowest branch point.

• Compute hl
• Proceed to the upper branch point of hl
• Consider the other son of the branchpoint
• Change path from that son to the root of tree so that hl is not included
• Mark as non-present the leaf and the path above until the “former” upper brachpoint of hl
Summary
• What is important in these operations is that when inserting or deleting you only deal with the canonical subtree of the father of a leaf.
• Basically the operations are done on the subtree of height k, which affects the whole tree of height 2^k, without touching the rest of the tree. And that’s why the time complexity of operations is O(loglogn) instead of O(logn).
Conclusions
• Comparisons
Conclusions(Cont’d)
• Efficient PQ to work with VERY large amounts of data
• VERY difficult to implement
• Can’t be used for Real-Valued Priority Queues.
• Space – uses a full tree just for leaves
My Contributions
• Research on Subject
• Web
• Periodicals
• Books
• LEDA