1 / 7

update

Persistent Data Structures (Version Control ). Partial persistence. Full persistence. Confluently persistence. Purely functional. Ephemeral. version list. version DAG. version tree. v 0. v 0. v 0. v 0. car cdr. update. never modify only create new pairs only DAGs. v 1.

amara
Télécharger la présentation

update

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. Persistent Data Structures (Version Control) Partialpersistence Full persistence Confluently persistence Purelyfunctional Ephemeral version list version DAG version tree v0 v0 v0 v0 carcdr update nevermodify onlycreate new pairs onlyDAGs v1 v1 v1 v2 v1 v2 v2 v2 v3 v6 v3 queryonly v3 v3 v4 v5 v5 update/merge/queryall versions updates at leaves any version canbecopiedquery all versions v4 v4 v5 v5 Retroactive v0 v1 v2 v3 v4 v6 v6 update & query all versions updates in the pastpropragate update& query query

  2. Planar Point Location T1 T2 T3 T4 T5 T6 T7 Partialpersistentsearchtrees update O(n∙log n) preprocessing, O(log n) query

  3. Pathcopying (trees) root pointer c c a f f d e g

  4. Partialpersistence [0,8[ [8,13[ [13,[ • Version ID = time = 0,1,2,... • Fast node (any data structure) • record all updates in node (version,value) pairs • fieldupdates O(1) • fieldqueries predecessorwrt version id (searchtree/vEB) • Node copying (O(1) degree data structures) • Persistent node = collectionof nodes, each valid for an interval of versions, with extraupdates,  = max indegree • pointers must have subinterval of the node pointing to; otherwisecopy and insert pointers (cacadingcopying)NB: Needs to keeptrack of back-pointers

  5. Fullpersistence 1 4 3 2 increasing version 1 4 7 5 3 6 2 preordertraversal Version list (ordermaintenance data structure) 7 5 6 Version tree (numbers = version ids) [5,3[ [4,3[ [4,5[ [0,5[ [5,[ [0,[ split version 5 • Fat node • Updates (1,x) (6,y) (7,z) to a field • Queries = binarysearchamong versions • Update (7,z): Insert 7 as leftmostchild of 4; insert pairs for 7 and 5=succ(7) • Node splitting (≥2 ekstra fields)

  6. Persistencetechniques [N. Sarnak, R.E. Tarjan, Planar point location using persistent search trees, Communications of the ACM, 29(7), 669-679, 1986] Partialpersistence, trees, O(1) access, amortized O(1) update [J.R. Driscoll, N. Sarnak, D.D. Sleator, R.E. Tarjan, Making Data Structures Persistent, Journal of Computer and System Sciences, 38(1), 86-124, 1989] Partial & fullpersistence, O(1) degree data structures, O(1) access, amortized O(1) update [P.F. Dietz, R. Raman, Persistence, Amortization and Randomization. Proceedings 2nd Annual ACM-SIAM Symposium on Discrete Algorithms, 78-88, 1991][G.S. Brodal, Partially Persistent Data Structures of Bounded Degree with Constant Update Time,Nordic Journal of Computing, volume 3(3), pages 238-255, 1996] Partialpersistence, O(1) degree data structures, O(1) access & updatesupdate [P.F. Dietz, Fully Persistent Arrays. Proceedings 1st Workshop on Algorithms and Data Structures, LNCS 382, 67-74, 1989] Fullpersistence, RAM structures, O(loglog n) access, O(loglog n) amortizedexpectedupdates

  7. Comparison of persistencetechniques • Copy data structure for each version • noquery overhead, slowupdates& wastes a lot of space • Recordupdates & keepcurrent version • fast updates & queries to current version, spaceefficient, slowqueries in the past • Pathcopying • applies to trees, noquery overhead, space overhead = depth of update • Fat node • partialpersistence: O(1) updates and space optimal, loglog n query overhead • fullpersistence: O(loglog n) expectedamortizedupdatesand space optimal, loglog n queryoverhead • Node copying/splitting • fast updates &queries (amortizedupdates for fullpersistence) • onlyworks for pointer-basedstructureswith O(1) degree

More Related