Download presentation
Presentation is loading. Please wait.
1
Relaxed Balancing Advanced Algorithms & Data Structures Lecture Theme 09 Prof. Dr. Th. Ottmann Summer Semester 2006
2
2 Example: Balanced search tree Problem: Updates come in sudden bursts (Example: Recording ink-traces from pen input) Not enough time to serialize insertions and rebalancing transformations Solution: Relaxed balancing: Carry out updates and rebalancing transformations concurrently! 10 615 291123 572030 679 101115 5 2 2023
3
3 Standard Balancing Update operations and restructurings are carried out strictly sequentially. Next search operation can be performed only when all restructurings (pointer changes) have been completed. 12 3 1 23
4
4 Stratified search trees.... ….. … … … …
5
5 Stratified search trees A stratified search tree with n leaves has height at most log 2 n. Stratified search trees may be considered as a version of 2-3-4-trees (B-tress of order 4)
6
6 Example
7
7
8
8 Insertion Insert the new key among the leaves at the expected position and deposit a „push-up-request“ … … …….... ….. x p
9
9 Iterative sequence of insertions
10
10 Handling of push-up-requests (1) A push-up-request either leads to a local structural change and halt, which can be carried out in time O(1) (Case 1) or (exclusively) to a recursive shift of the push-up-requests to the next higher stratum without any structural change (Case 2) Case 1 [There is still room on the next higher stratum] 123 12 3 12 34 1234 1 23 4 2314
11
11 Handling of push-up-requests (2) Case 2 [Next higher stratum is full] Append a new apex, if node is pushed over topmost stratum boarder 1 23 45 1 23 45
12
12 Deletion Locate x among the leaves. Deposit a removal request at x. Handle removal request. … … …….... ….. ……
13
13 Handling removal requests Case 1 [Enough nodes at bottommost stratum] Case 2 [Bottommost stratum too sparse] Deposit „pull-down-request“ pq q
14
14 Handling of pull-down-requests (1) 1p231p23 1p234p1234 1p23 4 1234p Case1 [There are enough nodes on next higher stratum] Finite structural change and Halt!
15
15 Handling of pull-down-requests (2) p q q p Case 2 [Not enough nodes on next higher stratum] Recursively shift pull-down-request to next higher stratum, but no structural change!
16
16 Z-stratified search trees: Observations Insertions, deletions, and rebalancing-transformations (removal of, ) can be arbitrarily interleaved. The amortized restructuring costs per insertion or deletion are constant. The generation history of a current version may be partially reconstructed (Sequence of insertions and deletions are partially visible) But: Update operations are always applied to the current version Z-stratified search trees are not persistent
17
17 Example of a randomised structure Z-stratified search tree On each stratum, randomly choose the distribution of trees from Z. Insertion? Deletion? … … …….... …..
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.