Priority Search Trees - PowerPoint PPT Presentation

About This Presentation
Title:

Priority Search Trees

Description:

Priority Search Trees. Keys are distinct ordered pairs (xi, ... Search tree is a radix search tree. Radix Priority Search Tree (RPST) Radix Priority Search Tree ... – PowerPoint PPT presentation

Number of Views:1096
Avg rating:3.0/5.0
Slides: 20
Provided by: CISE9
Learn more at: https://www.cise.ufl.edu
Category:
Tags: priority | radix | search | trees

less

Transcript and Presenter's Notes

Title: Priority Search Trees


1
Priority Search Trees
  • Keys are pairs (x,y).
  • Basic (search, insert, delete) and rectangle
    operations.
  • Two varieties.
  • Based on a balanced binary search tree such as a
    red-black tree.
  • Red-black Priority Search Tree (RBPST)
  • Based on a radix search tree.
  • Radix Priority Search Tree (RPST)

2
Radix Priority Search Tree
  • All x values are different, integer, and in the
    range 0, k 1.
  • Each node of the priority search tree has exactly
    one element.
  • Min tree on y.
  • Radix tree on x.

3
Radix Priority Search Tree
  • The y value of the element in node w is lt the y
    value of all elements in the subtree rooted at w
    (y values define a min tree).
  • Root interval is 0,k).
  • Interval for node w is a,b).
  • Left child interval is a, floor((ab)/2)).
  • Right child interval is floor((ab)/2, b)).

4
Insert
  • Start with empty RPST.
  • k 16.
  • Root interval is 0,16).
  • Insert (5,8).
  • Insert (6,9).
  • (5,8) remains in root, because 8 lt 9.
  • (6,9) inserted in left subtree, because 6 is in
    the left child interval.

5
Insert
  • Insert (7,1).
  • (7,1) goes into the root, because 1 lt 8.
  • (5,8) inserted in left subtree, because 5 is in
    the left child interval.
  • (5,8) displaces (6,9), because 8 lt 9.
  • (6,9) inserted in right subtree, because 6 is in
    the right child interval.

6
Insert
  • Insert (11,5).

7
Properties
  • Height is O(log k).
  • Insert time is O(log k).

8
Search
  • Search time is O(log k).

9
Delete
  • Similar to delete min of min heap.
  • Delete time is O(log k).

10
minXinRectangle(xL,xR,yT)
  • minXinRectangle(6,12,7).
  • Time is O(log k).

11
Complexity
Profile of visited
nodes. Node is visited iff its y is checked for
being ok/notOK. This check is done only at nodes
with an x-range overlap.
12
Complexity
Yellow node is node closest to root with 2
examined children.
13
Complexity
No yellow node ? O(log k) examined nodes Yellow
node ? unique
14
Complexity
Assume both children of the yellow node are yok.
The other cases are similar.
15
Complexity
No other node in the yellow nodes subtree can
have two children marked yok.
16
Complexity
nodes visited lt 4log k.
17
maxXinRectangle(xL,xR,yT)
  • maxXinRectangle(6,12,7).
  • Time is O(log k).

18
minYinXrange(xL,xR)
  • minYinXrange(6,10).
  • Time is O(log k).

19
enumerateRectangle(xL,xR,yT)
  • enumerateRectangle(6,12,8).
  • Time is O(log k s), where s is points in
    rectangle.
Write a Comment
User Comments (0)
About PowerShow.com