3 views

Uploaded by djoseph_1

from MIT OCW

save

- Clone-Based Mobile Agent Itinerary Planning Using Separate Trees For Data Fusion In WSNS
- pgfmanual
- Lesson 3.1- Problem Solving through Search.pptx
- test2fall97
- An Efficient Data Gathering Mechanism using M_Collectors
- Memphis Usage
- A Distributed K-Mutual Exclusion Algorithm, Shailaja & Nitin, 1994
- ICCIT 2005 Shifting Paper
- Trees
- Btree
- pgfmanualCVS2010-04-18
- Practice Final CS61c
- Two 3 Trees Deletion
- The Theory Of Games And Game Models.pdf
- TREE.doc
- stress3
- CH5.ppt
- DM-DecisionTree.pdf
- Recommending Questions Using the MDL-based Tree Cut Model
- DS
- syllabus
- daa project file
- Sabrina Gerth and Peter beim Graben- Unifying syntactic theory and sentence processing difficulty through a connectionist minimalist parser
- Data Structures and Algorithms Question Bank
- 03 Data Structures
- AVL_BJD
- Lecture 2
- Ropes vs Strings
- lab6
- a-comparative-study-of-multi-relational-decision-tree-learning-algorithm
- MIT9 85F12 Practicum
- MIT21M_030S13_exam1review
- MIT6_851S12_ps3
- MIT6_851S12_ps4
- MIT6_851S12_ps4sol
- MIT9 85F12 Proposal
- MIT9 85F12 Final Project
- MIT9 85F12 Brochure
- MIT6_851S12_ps3sol
- MIT9 85F12 Cr Tips
- MIT9 85F12 Cr Guidelines
- MIT9_85F12_brochureblank
- MIT6_851S12_ps5
- MIT21M_030S13_exam2review
- MIT6_851S12_ps2sol
- MIT17_871S12_Intro
- MIT6_851S12_ps9sol
- MIT6_851S12_ps5sol
- MIT6_851S12_ps7
- MIT6_851S12_ps8sol
- MIT6_851S12_ps2
- MIT6_851S12_ps7sol
- MIT6_851S12_ps6sol
- MIT6_851S12_ps8
- MIT6_851S12_ps10
- MIT6_851S12_ps10sol
- MIT6_851S12_ps1
- MIT6_851S12_ps9
- MIT6_851S12_ps6

You are on page 1of 2

Erik Demaine Problem 1 Sample solution

Creationist successor data structure. The data structure is a balanced BST, such as an AVL tree or red black tree, augmented with the following ﬁelds augmented to each node x: • td : The time at which x is deleted • tm : The maximal deletion time among x’s subtree Operations. The three operations are done as following:

• Insert(−∞, “insert(k)”): The key k is inserted into the BST, with its deletion time set to ∞. We also set all its ancestors’ maximal deletion time to ∞. Rotations are done to balance the tree. During rotation, the property that each note’s tm stores its subtree’s maximal deletion time is preserved. This is easy because we only need to update the maximal deletion times of the nodes being rotated. The insertion, the update for ancestors, and the rotations each takes O(log n) time, where n is the number of elements in tree. • Insert(t, “delete(k)”): The key k is deleted at time t. Locate k in the BST. Its deletion time td should be greater than t. Change its deletion time td to t, and walk back to the root, updating the maximal deletion time of all nodes on path. Both the locating and updating takes O(log n) time. • Delete(−∞, “insert(k)”): Delete the key k from the BST. We then update all of the maximal deletion times of the ancestors of k . Both the deletion and the update take O(log n) time. • Delete(t, “delete(k)”): Locate k in the BST. Increase its deletion time to ∞, and set it and all of its ancestors’ maximal deletion times to ∞. Both the locating and updating take O(log n) time. • Query(t, “successor(k)”): We will essentially perform the standard successor search, except that we will use the tm ’s to only walk over the elements of the tree where the keys have not been deleted. Speciﬁcally, we will start by ﬁnding key k ’s successor k ' in the tree. If k ' ’s deletion time is greater than t, then return k ' , otherwise do the following. Walk up the tree, until the ﬁrst right subtree whose maximal deletion time is greater than t. Walk down that subtree, avoiding all subtrees whose maximal deletion time is smaller or equal than t, and ﬁnd the smallest element (at time t). This is k ’s successor at t. The walking up and down takes O(log n) time. Analysis of operation time. This data structure has O(log n) for all operations, where n is the number of elements in tree. We have n ≤ m, where m is the total number of updates. Therefore the data structure has operation time O(log m) (for all operations.)

1

851 Advanced Data Structures Spring 2012 For information about citing these materials or our Terms of Use.MIT OpenCourseWare http://ocw. visit: http://ocw.edu/terms.edu 6. .mit.mit.

- Clone-Based Mobile Agent Itinerary Planning Using Separate Trees For Data Fusion In WSNSUploaded byJohn Berg
- pgfmanualUploaded byGiselle Azevedo
- Lesson 3.1- Problem Solving through Search.pptxUploaded byMK
- test2fall97Uploaded bysatya_baral
- An Efficient Data Gathering Mechanism using M_CollectorsUploaded bythesij
- Memphis UsageUploaded byAmr Emam
- A Distributed K-Mutual Exclusion Algorithm, Shailaja & Nitin, 1994Uploaded byb33law
- ICCIT 2005 Shifting PaperUploaded bynobeen666
- TreesUploaded byGobara Dhan
- BtreeUploaded byakshatdua
- pgfmanualCVS2010-04-18Uploaded byrobsonpessoa2007gmai
- Practice Final CS61cUploaded byEdward Yixin Guo
- Two 3 Trees DeletionUploaded byAmmar Sohail
- The Theory Of Games And Game Models.pdfUploaded byp_rosalin2506
- TREE.docUploaded bySayani Chandra
- stress3Uploaded bykashif salman
- CH5.pptUploaded byKarthikeyan Ramajayam
- DM-DecisionTree.pdfUploaded byRohan Chawhan
- Recommending Questions Using the MDL-based Tree Cut ModelUploaded bymachinelearner
- DSUploaded byRocking Anish
- syllabusUploaded byAshokvannan
- daa project fileUploaded byYogesh Kathayat
- Sabrina Gerth and Peter beim Graben- Unifying syntactic theory and sentence processing difficulty through a connectionist minimalist parserUploaded byAsvcxv
- Data Structures and Algorithms Question BankUploaded byRamKrishnaMurti
- 03 Data StructuresUploaded byrameshramyb
- AVL_BJDUploaded bysumanth desu
- Lecture 2Uploaded byHabtamu Setu
- Ropes vs StringsUploaded bymedium-chain
- lab6Uploaded byapi-385529402
- a-comparative-study-of-multi-relational-decision-tree-learning-algorithmUploaded byIJSTR Research Publication

- MIT9 85F12 PracticumUploaded bydjoseph_1
- MIT21M_030S13_exam1reviewUploaded bydjoseph_1
- MIT6_851S12_ps3Uploaded bydjoseph_1
- MIT6_851S12_ps4Uploaded bydjoseph_1
- MIT6_851S12_ps4solUploaded bydjoseph_1
- MIT9 85F12 ProposalUploaded bydjoseph_1
- MIT9 85F12 Final ProjectUploaded bydjoseph_1
- MIT9 85F12 BrochureUploaded bydjoseph_1
- MIT6_851S12_ps3solUploaded bydjoseph_1
- MIT9 85F12 Cr TipsUploaded bydjoseph_1
- MIT9 85F12 Cr GuidelinesUploaded bydjoseph_1
- MIT9_85F12_brochureblankUploaded bydjoseph_1
- MIT6_851S12_ps5Uploaded bydjoseph_1
- MIT21M_030S13_exam2reviewUploaded bydjoseph_1
- MIT6_851S12_ps2solUploaded bydjoseph_1
- MIT17_871S12_IntroUploaded bydjoseph_1
- MIT6_851S12_ps9solUploaded bydjoseph_1
- MIT6_851S12_ps5solUploaded bydjoseph_1
- MIT6_851S12_ps7Uploaded bydjoseph_1
- MIT6_851S12_ps8solUploaded bydjoseph_1
- MIT6_851S12_ps2Uploaded bydjoseph_1
- MIT6_851S12_ps7solUploaded bydjoseph_1
- MIT6_851S12_ps6solUploaded bydjoseph_1
- MIT6_851S12_ps8Uploaded bydjoseph_1
- MIT6_851S12_ps10Uploaded bydjoseph_1
- MIT6_851S12_ps10solUploaded bydjoseph_1
- MIT6_851S12_ps1Uploaded bydjoseph_1
- MIT6_851S12_ps9Uploaded bydjoseph_1
- MIT6_851S12_ps6Uploaded bydjoseph_1