1 / 14

IPR

Internal Path Reduction Tree. IPR. IPR Trees are with no doubt superior compared to AVL Trees.

zwi
Télécharger la présentation

IPR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Internal Path Reduction Tree IPR

  2. IPR Trees are with no doubt superior compared to AVL Trees There are many variations of balanced and semi-balanced binary trees. One of them, which is due to the work of Gaston H. Gonnet published in 1983, is the Internal Path Reduction (IPR) tree. Its height is the same as the AVL tree, but produces a slightly more compact structure. The internal path (IP) is defined as the sum of the path lengths of all nodes measured from the root. On average, the IPR tree produces an internal path of about 10% smaller than the AVL one. In addition, the IPR tree has a tunable parameter that determines the acceptable level of imbalance. IPR

  3. AVL vs. IPR • Both are BSTs • Both are HB(1) • They do not tolerate imbalance and the tree is restored to a proper shape by predefined rotations. • IPR rotations are geared towards reducing IP in the tree (IP = Σpath length from Nodei to root i=1 to n ) • AVL has attracted much more attention in the literature but IPR is kinda forsaken IPR

  4. Single right rotation X Nc> Na a Y IPR c b More Nodes to The Left of X

  5. Double right rotation X Nb> Na a Y IPR c b b1 b2 More Nodes to The Left of X

  6. Before Rotation MoreNodes to The Left of X (SRR) 2Nc+IPc+2Nb+IPb+Na+IPa+3 IPR After Rotation Nc+IPc+2Nb+IPb+2Na+IPa+3 IP1 > IP2 Nc > Na

  7. More Nodes to The Left of X (DRR) Before Rotation 2Nc+IPc+3Nb1+IPb1+3Nb2+IPb2 +Na+IPa+6 IPR After Rotation 2Nc+IPc+2Nb1+IPb1+2Nb2+IPb2 +2Na+IPa+5 IP1 > IP2 Nb > Na

  8. Single Left Rotation X a Y IPR Nc > Na c b More Nodes to The Right of X

  9. Double Right Rotation X Nb> Na a Y IPR b c b1 b2 More Nodes to The Left of X

  10. 20 17 11 20 17 11 IPR

  11. 11 5 14 8 15 16 17 20 11 5 14 IPR 8 15 16

  12. 16 11 5 17 20 8 14 IPR 15 16

  13. 16 11 5 17 20 8 15 IPR 14 16

  14. Summary of Worst Case Complexities AVL IPR IPR <=1.4402 log2n <=1.4402 log2n Height >=1.2793 nlog2n 1.0515 nlog2n Internal Path Length

More Related