ASSALAMU ALAIKUM
Hello Everyone Welcome to Our
Presentation
Presented By
▪ Md. Hasan Ali
▪ Md. Rezwanul Haque
▪ Nayan Kumar Rudro
Presentation Topics
Splay tree & Euler tour tree
What is SPLAY TREE ?
▪ The splay tree was invented by Daniel Dominic Sleator and Robert
EndreTarjan in 1985.
▪ Splay trees are self branching binary search tree which has the
property of reassessing the elements quickly that is recently
accessed.
▪ The performance of the Splay trees depends on the self balancing
and self optimizing.
▪ The worst case with this splay tree algorithm is that this will
sequentially access all the elements of the tree which makes tree
unbalanced.
What is Self Branching ?
5 10
15
3
5
10
10
5
15
15
10
5
3
15
3
5
10
3
3
15
5
10
Real Time Applications
It is used to implement Caches.
It has the ability of not to store any data,
which results in Minimization of memory
requirements.
It can also be used for data compression, e.g.
Dynamic Huffman coding.
Advantages & Disadvantages
Advantages:
 It is easy to implement than other self branching binary
search trees ,such as Red black trees or AVL trees .Much
simpler to code than AVL, Red Black trees.
 It requires less space as no balance information is required.
Disadvantages:
 More local adjustments during Search operations.
 Individual operations can be expensive , Draw back for real-
time applications.
 The main disadvantage of Splay trees is the height . After
accessing all ‘ n ‘ elements in the tree ,The height of the tree
corresponds to worst case access time.
Operations
The main basic operations of the Splay tree are
 Search
 Insert
 Delete
 Splaying
Search , Insert , Delete operations are like in Binary Search trees, except at
the end of each operation ,a special step called Splaying is done .Splaying
the tree rearranges the tree so that element is placed at the root of the
tree .It uses tree rotations to bring the element to the top.
When to Splay?
Search :Splay node where key was found.
Insert :When an item is inserted ,a Splay is performed .As a result ,
the newly inserted node becomes the root of the tree.
Delete :Splay parent of removed node which is either the node
with the deleted key or its successor.
Splaying
There are three types of Splay steps are
 Zig step
 Zig-Zag step
 Zig-Zig step
Zig step
P
X
P
X
P
X
P
X
Zig-Zag step
P
P
G
X
P
G
X
X
G
P
X
G
P
X
GG
X
P
Zig-Zig step
P
G
X
P
G
X
P
G
X
P
G
X
Example
5 10
15
3
5
10
10
5
15
15
10
5
3
15
3
5
10
3
3
15
5
10
Results of Splaying
The result is a binary tree , with the left sub tree having
all keys less than the root ,and the right sub tree having
keys greater than the root.
 The resulted tree is more balanced than the original
tree.
 If an operation near the root is done ,the tree can
become less balanced.
TIME COMPLEXITY
 For ‘ m ‘ operations to be performed on splay tree it requires
O( mlogn) steps where n is the size of the tree . On an average
the time complexity of each operation on the splay tree is :
 Search : Searching for a node in the tree would take O( logn).
 Insert :Inserting a node in to the tree takes O( logn).
 Delete : Deleting a node from the tree takes O( logn).
Euler Tour Tree
 Who Invented EulerTourTree?
EulerTourTree was invented by Leonhard Euler.
 What is EulerTourTree?
A data structure for Dynamic Connectivity
What is Dynamic Connectivity?
Maintaining connectivity in a changing environment.
How it Works?
S
1 5
3
4
2
6
Output : 1 2 6 6 2 4 4 1 3 3 5 5
Application
•DynamicTrees as SearchTreesVia EulerTours.
•Applied to the Network Simples Algorithm.
Do you have any Question?
Feel free to ask any of us
We will try our Best to Answer.
Thanksto
Each && Everyone.

Splay tree && euler tour tree

  • 1.
    ASSALAMU ALAIKUM Hello EveryoneWelcome to Our Presentation
  • 2.
    Presented By ▪ Md.Hasan Ali ▪ Md. Rezwanul Haque ▪ Nayan Kumar Rudro
  • 3.
  • 4.
    What is SPLAYTREE ? ▪ The splay tree was invented by Daniel Dominic Sleator and Robert EndreTarjan in 1985. ▪ Splay trees are self branching binary search tree which has the property of reassessing the elements quickly that is recently accessed. ▪ The performance of the Splay trees depends on the self balancing and self optimizing. ▪ The worst case with this splay tree algorithm is that this will sequentially access all the elements of the tree which makes tree unbalanced.
  • 5.
    What is SelfBranching ? 5 10 15 3 5 10 10 5 15 15 10 5 3 15 3 5 10 3 3 15 5 10
  • 6.
    Real Time Applications Itis used to implement Caches. It has the ability of not to store any data, which results in Minimization of memory requirements. It can also be used for data compression, e.g. Dynamic Huffman coding.
  • 7.
    Advantages & Disadvantages Advantages: It is easy to implement than other self branching binary search trees ,such as Red black trees or AVL trees .Much simpler to code than AVL, Red Black trees.  It requires less space as no balance information is required. Disadvantages:  More local adjustments during Search operations.  Individual operations can be expensive , Draw back for real- time applications.  The main disadvantage of Splay trees is the height . After accessing all ‘ n ‘ elements in the tree ,The height of the tree corresponds to worst case access time.
  • 8.
    Operations The main basicoperations of the Splay tree are  Search  Insert  Delete  Splaying Search , Insert , Delete operations are like in Binary Search trees, except at the end of each operation ,a special step called Splaying is done .Splaying the tree rearranges the tree so that element is placed at the root of the tree .It uses tree rotations to bring the element to the top.
  • 9.
    When to Splay? Search:Splay node where key was found. Insert :When an item is inserted ,a Splay is performed .As a result , the newly inserted node becomes the root of the tree. Delete :Splay parent of removed node which is either the node with the deleted key or its successor.
  • 10.
    Splaying There are threetypes of Splay steps are  Zig step  Zig-Zag step  Zig-Zig step
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
    Results of Splaying Theresult is a binary tree , with the left sub tree having all keys less than the root ,and the right sub tree having keys greater than the root.  The resulted tree is more balanced than the original tree.  If an operation near the root is done ,the tree can become less balanced.
  • 16.
    TIME COMPLEXITY  For‘ m ‘ operations to be performed on splay tree it requires O( mlogn) steps where n is the size of the tree . On an average the time complexity of each operation on the splay tree is :  Search : Searching for a node in the tree would take O( logn).  Insert :Inserting a node in to the tree takes O( logn).  Delete : Deleting a node from the tree takes O( logn).
  • 17.
    Euler Tour Tree Who Invented EulerTourTree? EulerTourTree was invented by Leonhard Euler.  What is EulerTourTree? A data structure for Dynamic Connectivity What is Dynamic Connectivity? Maintaining connectivity in a changing environment.
  • 18.
    How it Works? S 15 3 4 2 6 Output : 1 2 6 6 2 4 4 1 3 3 5 5
  • 19.
    Application •DynamicTrees as SearchTreesViaEulerTours. •Applied to the Network Simples Algorithm.
  • 20.
    Do you haveany Question? Feel free to ask any of us We will try our Best to Answer.
  • 21.