Download Two Simplified Algorithms for maintaining Order in a List

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Nucleosynthesis wikipedia , lookup

Transcript
Two Simplified Algorithms for maintaining Order in a List
Michael A Bender, Richard Cole, Erik D Demaine, Martin Farach-Colton, Jack Zito
Summarised by Ayush Tulsyan
1
Introduction
The Order-Maintenance Problem is to maintain a total order subject to the following operations:
• Insert (X,Y): Insert a new element Y immediately after element X in the total Order.
• Delete (X): Remove an element X from the total order.
• Order (X,Y): Determine whether X precedes Y in the total order.
The fastest known order data structures was presented in a classic paper by Dietz and Sleator. They proposed two data
structures: one supports insertions and deletions in O(1) amortized time and queries in O(1) worst-case time; the other
is a complicated data structure that supports all operations in O(1) worst-case time. Drawback of Dietz and Sleator’s
algorithm was the complex proof and paradoxical increase in upper bound of relabels on increasing the size of data
structure. They listed this anomaly in their paper as a shortcoming of their analysis.
The writers continue on the work of Dietz and Sleator to provide a simple algorithm with a simple proof. They experimentally show that their alogirthm dominates the old one in terms of bit/relabel tradeoff.
They provide a solution which takes O(log n) amortized time to update and O(1) query time. Also, the standard technique
to modify their solution in a two level data structure where the bottom level has theta(logn) elemens and the top level
has θ(n/ log n) elements. This would result in improving the update time to O(1) amortized time with O(1) query time.
2
Approach
The elements are allotted tags in a universe whose size is polynomial in size of the list. So, let’s say for a list of n elements,
we have a universe [0, u) where u = nc for some constant c. These elements are maintained in a tree. Their location in
the tree is decided by the binary representation of the tags. This form a trie like structure.
In case of insertion, if a element f has to be inserted between e and g, and e and g are adjacent. i.e. their tags differ by 1,
a procedure of relabelling is carried out. A sub-tree which is overflowing is looked for and then it is relabelled so that the
current insertion routine can be completed. To judge if a sub-routine is overflowing, the authors define a function on the
depth of root of sub-tree w.r.t. to universe’s root. The time taken for relabelling is linear and thus provides amortized
O(1) time for insertion.
Deletions and Order queries can also be handled with this structure.
1