SlideServe
Menu
Préférences
© SlideServe · v2026

Priority Search Trees

duaa avatar
18 diapositives · 1.9K Views · Sep 10, 2014

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).

Priority Search Trees - slide 1
01 / 18Priority Search Trees
1 / 17

Télécharger la présentation

Priority Search Trees
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  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, integral, 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 <= 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((a+b)/2)). • Right child interval is [floor((a+b)/2, b)).

  4. [0,16) [0,16) 5,8 5,8 6,9 [0,8) 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 < 9. • (6,9) inserted in left subtree, because 6 is in the left child interval.

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

  6. [8,16) 11,5 [0,16) [0,16) [4,8) 7,1 5,8 6,9 7,1 5,8 6,9 [0,8) [0,8) [4,8) Insert • Insert (11,5).

  7. [0,8) [8,16) 11,5 [0,16) [0,4) [4,8) 2,12 7,1 5,8 6,9 Properties • Height is O(log k). • Insert time is O(log k).

  8. [0,8) [8,16) 11,5 [0,16) [0,4) [4,8) 2,12 7,1 5,8 6,9 Search • Search time is O(log k).

  9. [0,8) [8,16) 11,5 [0,16) [0,4) [4,8) 2,12 7,1 5,8 6,9 Delete • Similar to delete min of min heap. • Delete time is O(log k).

  10. [0,16) 12,1 [0,8) [8,16) 11,5 [12,16) [0,4) [4,8) 2,12 5,8 6,9 14,6 minXinRectangle(xL,xR,yT) • minXinRectangle(6,12,7). • Time is O(log k).

  11. yok yok yok ynotOK ynotOK yok yok ynotOK yok yok ynotOK ynotOK ynotOK Complexity Profile of visited nodes.

  12. yok yok yok ynotOK ynotOK yok yok ynotOK yok yok ynotOK ynotOK ynotOK Complexity Yellow node is node closest to root with 2 examined children.

  13. yok yok yok ynotOK ynotOK yok yok ynotOK yok yok ynotOK ynotOK ynotOK Complexity No yellow node  O(log k) examined nodes Yellow node  unique

  14. yok yok yok ynotOK ynotOK yok yok ynotOK yok yok ynotOK ynotOK ynotOK Complexity No node in the yellow node’s subtree can have two children marked yok.

  15. yok yok yok ynotOK ynotOK yok yok ynotOK yok yok ynotOK ynotOK ynotOK Complexity # nodes visited < 4log k.

  16. [0,16) 12,1 [0,8) [8,16) 11,5 [12,16) [0,4) [4,8) 2,12 5,8 6,9 14,6 maxXinRectangle(xL,xR,yT) • maxXinRectangle(6,12,7). • Time is O(log k).

  17. [0,16) 12,1 [0,8) [8,16) 11,5 [12,16) [0,4) [4,8) 2,12 5,8 6,9 14,6 minYinXrange(xL,xR) • minYinXrange(6,10). • Time is O(log k).

  18. [0,16) 12,1 [0,8) [8,16) 11,5 [12,16) [0,4) [4,8) 2,12 5,8 6,9 14,6 enumerateRectangle(xL,xR,yT) • enumerateRectangle(6,12,8). • Time is O(log k + s), where s is #points in rectangle.