k: 5
DESCRIPTION
K: 5. P: 9. K:1. K: 8. P:2. P: 6. K: 7. P: 4. K: 5. P: 9. K:1. K: 8. P:2. P: 6. Is the treap a heap?. K: 7. P: 4. P: 9. P:2. P: 6. For every node v, the search key in v is greater than or equal to those in the children of v. P: 4. K: 5. P: 9. K:1. K: 8. P:2. P: 6. - PowerPoint PPT PresentationTRANSCRIPT
P: 9
P:2P: 6
P: 4
For every node v, the search key in v is greater than or equal to those in the children of v
K: 5
K:1 K: 8
K: 7
All keys smaller than the root are stored in the left subtree
All keys larger than the root are sorted in the right subtree
K:2P:5
K:5P:2
K:3P:1
K:4P:7
K:9P:4
K:8P:3
Without destroying left to right arrangement,Shift the “nodes” up and down
Biggest priority
Smallest priority