1 / 15

ESA’06, Zürich, Switzerland, September 13, 2006

Purely Functional Worst Case Constant Time Catenable Sorted Lists Gerth Stølting Brodal University of Aarhus Joint work with Christos Makris Kostas Tsichlas University of Patras. ESA’06, Zürich, Switzerland, September 13, 2006. This talk. Catenable Sorted Lists. Insert( T , x )

brina
Download Presentation

ESA’06, Zürich, Switzerland, September 13, 2006

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. Purely Functional Worst Case Constant TimeCatenable Sorted ListsGerth Stølting BrodalUniversity of AarhusJoint work withChristos Makris Kostas TsichlasUniversity of Patras ESA’06, Zürich, Switzerland, September 13, 2006

  2. This talk Catenable Sorted Lists • Insert(T,x) • Delete(T,x) • Search(T,x) • Join(T1,T2 ) • Split(T,x) T1 = 2,5,7,8,10,11T2=13,17,19,34,58,79 Join(T1,T2 ) = 2,5,7,8,10,11,13,17,19,34,58,79

  3. Catenable Sorted Lists: Search Trees (2,4-trees, red-black trees…) T1 Rebalance 3 Link 2 T2 Search 1

  4. T1 Rebalance 3 Link 2 T2 Search 1 Catenable Sorted Lists: Search Trees (2,4-trees, red-black trees…) 1 Worst-case O(log |T2|) or O(loglog |T2|) or amortized O(1) 2 Worst-case O(1) 3 Worst-case O(log |T1|) or amortized O(1) or worst-case O(1)

  5. Catenable Sorted Lists n = |T| ns = min(|T1|,|T2|) * amortized

  6. O(1) Join and O(log n) SearchThe ideas….

  7. height O(log n) Problem: Nodes of arbitrary degree Idea 1: Linking By Size T1 T2

  8. O(log n) O(log n) Idea 2: Represent Nodes byWeight-Balanced Trees Problem: Does not support linking by size in O(1) time

  9. Idea 3: Tree-Collections and Lazy Join k trees k levels Weight- balanced tree Tree collection

  10. Idea 3 (cont.): Lazy Join k trees k levels Old tree collection New tree collection Weight balanced trees with top-down rebalancing [Bent, Sleator, Tarjan 1985]

  11. Catenable Sorted Lists

  12. O(log n) O(log n) Supporting Insertions: Buckets 2,4-tree

  13. Supporting Deletions: The ideas… • Delete leaf • Rebalance weight-balanced trees on root-to-leaf path • Join O(1) weight-balanced trees in O(log n) time

  14. Functional Catenable Sorte Lists • Functional setting = no side effects allowed • Data structures are automatically persistent • Idea: Represent spines by functional catenable lists [Kaplan, Tarjan 1995]

  15. Conclusion * amortized♪ purely functional

More Related