IPR Trees - PowerPoint PPT Presentation

About This Presentation
Title:

IPR Trees

Description:

Its height is the same as the AVL tree, but produces a slightly more ... IPR Trees are with no doubt superior compared to AVL Trees. AVL vs. IPR. Both are BSTs ... – PowerPoint PPT presentation

Number of Views:487
Avg rating:3.0/5.0
Slides: 15
Provided by: zahrazei
Category:
Tags: ipr | doubt | trees

less

Transcript and Presenter's Notes

Title: IPR Trees


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 Spath length from Nodei to root i1 to n
    )
  • AVL has attracted much more attention in the
    literature but IPR is kinda forsaken

IPR
4
Single right rotation
X
Nc gt Na
a
Y
IPR
c
b
More Nodes to The Left of X
5
Double right rotation
X
Nb gt Na
a
Y
IPR
c
b
b2
b1
More Nodes to The Left of X
6
  • More Nodes to The Left of X (SRR)

Before Rotation
2NcIPc2NbIPbNaIPa3

IPR
After Rotation
NcIPc2NbIPb2NaIPa3

IP1 gt IP2 Nc gt Na
7
More Nodes to The Left of X (DRR)
Before Rotation
2NcIPc3Nb1IPb13Nb2IPb2 NaIPa6
IPR
After Rotation
2NcIPc2Nb1IPb12Nb2IPb2 2NaIPa5
IP1 gt IP2 Nb gt Na
8
Single Left Rotation
X
a
Y
IPR
Nc gt Na
c
b
More Nodes to The Right of X
9
Double Right Rotation
X
Nb gt Na
a
Y
IPR
b
c
b2
b1
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
14
5
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
lt1.4402 log2n
lt1.4402 log2n
Height
gt1.2793 nlog2n
Internal Path Length
1.0515 nlog2n
Write a Comment
User Comments (0)
About PowerShow.com