SlideShare a Scribd company logo
1 of 45
Presentation 
CSE 225 
Team Members : 
1.Dewan Farhat-AL-Jami, ID-132 0771 042 
2.Md. Al Sahariar, ID- 131 0358 642 
3.Wasee Sarwar, ID- 132 0858 042
Splay 
Tree
What is Splay Tree? 
 Splay trees are self-adjusting binary search 
trees. 
 A node in a Binary_Search_Tree is 
"splayed" when it is moved to the root of the 
tree by one or more "rotations". 
 Whenever a node is accessed (Find, Insert, 
Remove, etc.), it is splayed, thereby making it 
the root. 
 In addition to moving the accessed node to 
the root, the height of the tree may be 
shortened.
Splay tree Rules 
Zig: Rotate the node about its parent 
(left or right). 
Zig_Zig: Rotate the parent about the 
grandparent (left or right), then rotate 
the node about its parent in the same 
direction. 
Zig_Zag: Rotate the node about its 
parent (left or right), then rotate the 
node about its grandparent in the other 
direction.
Zig (Rotate Right): 
splay* RR_Rotate(splay* k2) 
{ 
splay* k1 = k2->lchild; 
k2->lchild = k1->rchild; 
k1->rchild = k2; 
return k1; 
}
Zig (Rotate Left): 
splay* LL_Rotate(splay* k2) 
{ 
splay* k1 = k2->rchild; 
k2->rchild = k1->lchild; 
k1->lchild = k2; 
return k1; 
}
Functions: 
 Insert 
 Delete 
 Search
Inser 
t
Insert (5) 
5
Insert (10) 
5 
10
Insert (10) 
5 
10 
It will move to the ROOT
Insert (10) 
10 
5 
5 is less than 10 and moved to left 
Now 10 is the ROOT
Insert (15) 
10 
5 15
Insert (15) 
10 
5 15 
Now 15 will move to the ROOT
Insert (15) 
15 
10 
5 
10 is less than 15 and moved to 
left 
5 is less than 10 and moved to 
left
Insert (12) 
15 
10 
5 12
Insert (12) 
15 
10 
5 12 
Now 12 will move to the 
place of 10
Insert (12) 
15 
12 
10 
5 
12 moved to the place of 10 
10 is less than 12 and moved to 
left
Insert (12) 
15 
12 
10 
5 
12 will move to the ROOT
Insert (12) 
12 
10 
5 
15 
15 is greater than 12 and 
moved to the right
Insert Implementation : 
splay* Insert(int key, splay* root) 
{ 
static splay* p_node = NULL; 
if (!p_node) 
p_node = New_Node(key); 
else 
p_node->key = key; 
if (!root) 
{ 
root = p_node; 
p_node = NULL; 
return root; 
} 
root = Splay(key, root);
if (key < root->key) 
{ 
p_node->lchild = root->lchild; 
p_node->rchild = root; 
root->lchild = NULL; 
root = p_node; 
} 
else if (key > root->key) 
{ 
p_node->rchild = root->rchild; 
p_node->lchild = root; 
root->rchild = NULL; 
root = p_node; 
} 
else 
return root; 
p_node = NULL; 
return root; 
}
Delet 
e
Delete (4) from an existing tree 
6 
1 9 
4 7 
2
Delete (4) from an existing tree 
6 
1 9 
4 7 
2 Now 4 is going to be the 
ROOT
Delete (4) from an existing tree 
4 
4 is the root now 
1 6 
2 
7 
9
Delete (4) from an existing tree 
 4 has been Deleted and the tree has splited into 
2 parts 
1 6 
2 
7 
9
Delete (4) from an existing tree 
2 
1 
6 
As (2) is the largest 9 
element of the left sub 
tree, it will become the 
ROOT. 
7
Delete function Implementation: 
splay* Delete(int key, splay* root) 
{ 
splay* temp; 
if (!root) 
return NULL; 
root = Splay(key, root); 
if (key != root->key) 
return root;
else 
{ 
if (!root->lchild) 
{ 
temp = root; 
root = root->rchild; 
} 
else 
{ 
temp = root; 
root = Splay(key, root->lchild); 
root->rchild = temp->rchild; 
} 
free(temp); 
return root; 
} 
}
Search
Find (10) 
12 
10 
5 
15
Find (10) 
12 
10 
5 
15 
10 will move to the ROOT
Find (10) 
10 
5 
10 is FOUND as it is 
the ROOT now ! 
15 
12 
12 is greater than 10 
and moved to right
Zig-Zig 
1 
2 
3 
4 
5 
6 
1 
2 
3 
6 
5 
4 
Find (6)
1 
2 
3 
6 
5 
4 
1 
6 
3 
2 5 
4 
Find (6) 
zig-zig
1 
6 
3 
2 5 
4 
6 
1 
3 
2 5 
4 
Find (6) 
Zig
Search function 
Implementation: 
splay* Search(int key, splay* root) 
{ 
return Splay(key, root); 
}
Splay function implementation: 
splay* Splay(int key, splay* root) 
{ 
if (!root) 
return NULL; 
splay header; 
header.lchild = header.rchild = NULL; 
splay* LeftTreeMax = &header; 
splay* RightTreeMin = &header; 
while (1) 
{ 
if (key < root->key) 
{ 
if (!root->lchild) 
break; 
if (key < root->lchild->key) 
{ 
root = RR_Rotate(root); 
if (!root->lchild) 
break; 
}
RightTreeMin->lchild = root; 
RightTreeMin = RightTreeMin->lchild; 
root = root->lchild; 
RightTreeMin->lchild = NULL; 
} 
else if (key > root->key) 
{ 
if (!root->rchild) 
break; 
if (key > root->rchild->key) 
{ 
root = LL_Rotate(root); 
if (!root->rchild) 
break; 
} 
LeftTreeMax->rchild = root; 
LeftTreeMax = LeftTreeMax->rchild; 
root = root->rchild; 
LeftTreeMax->rchild = NULL; 
}
else 
break; 
} 
LeftTreeMax->rchild = root->lchild; 
RightTreeMin->lchild = root->rchild; 
root->lchild = header.rchild; 
root->rchild = header.lchild; 
return root; 
}
SPLAY TREE TIME COMPLEXITY 
Sorted List Search Insertion Deletion 
with arrays O(log n) O(n) O(n) 
with linked list O(n) O(n) O(n) 
With Splay 
trees 
O(log n) O(log n) O(log n)
Splay Tree Usage 
 Memory allocators 
 Routers 
 Garbage collectors 
 Data compression
Advantage : 
 Simple Implementation 
 Comparable performance 
 Small memory footprint 
 Working well with nodes containing 
identical keys 
Disadvantage: 
 Height can be linear 
 Extra management is needed if 
multiple threads are allowed to perform 
FIND operations. 
 Splay tree can be worse than Static 
tree.
Thank You !

More Related Content

What's hot

Binary Search Tree and AVL
Binary Search Tree and AVLBinary Search Tree and AVL
Binary Search Tree and AVLKatang Isip
 
Data structure tries
Data structure triesData structure tries
Data structure triesMd. Naim khan
 
Search tree,Tree and binary tree and heap tree
Search tree,Tree  and binary tree and heap treeSearch tree,Tree  and binary tree and heap tree
Search tree,Tree and binary tree and heap treezia eagle
 
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority QueueWhat is Stack, Its Operations, Queue, Circular Queue, Priority Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority QueueBalwant Gorad
 
Selection sort
Selection sortSelection sort
Selection sortstella D
 
Tree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanTree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanDaniyal Khan
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operationsKamran Zafar
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Treesagar yadav
 
Biconnected components (13024116056)
Biconnected components (13024116056)Biconnected components (13024116056)
Biconnected components (13024116056)Akshay soni
 

What's hot (20)

Quick sort
Quick sortQuick sort
Quick sort
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Multi ways trees
Multi ways treesMulti ways trees
Multi ways trees
 
BINARY SEARCH TREE
BINARY SEARCH TREEBINARY SEARCH TREE
BINARY SEARCH TREE
 
Linked list
Linked listLinked list
Linked list
 
Binary Search Tree and AVL
Binary Search Tree and AVLBinary Search Tree and AVL
Binary Search Tree and AVL
 
Data structure tries
Data structure triesData structure tries
Data structure tries
 
Search tree,Tree and binary tree and heap tree
Search tree,Tree  and binary tree and heap treeSearch tree,Tree  and binary tree and heap tree
Search tree,Tree and binary tree and heap tree
 
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority QueueWhat is Stack, Its Operations, Queue, Circular Queue, Priority Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
 
Tree
TreeTree
Tree
 
Selection sort
Selection sortSelection sort
Selection sort
 
Tree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanTree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal Khan
 
Binary tree
Binary treeBinary tree
Binary tree
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operations
 
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
 
Red black tree
Red black treeRed black tree
Red black tree
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Biconnected components (13024116056)
Biconnected components (13024116056)Biconnected components (13024116056)
Biconnected components (13024116056)
 
Tree Traversal
Tree TraversalTree Traversal
Tree Traversal
 
Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 

Recently uploaded

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 

Splay tree C++

  • 1. Presentation CSE 225 Team Members : 1.Dewan Farhat-AL-Jami, ID-132 0771 042 2.Md. Al Sahariar, ID- 131 0358 642 3.Wasee Sarwar, ID- 132 0858 042
  • 3. What is Splay Tree?  Splay trees are self-adjusting binary search trees.  A node in a Binary_Search_Tree is "splayed" when it is moved to the root of the tree by one or more "rotations".  Whenever a node is accessed (Find, Insert, Remove, etc.), it is splayed, thereby making it the root.  In addition to moving the accessed node to the root, the height of the tree may be shortened.
  • 4. Splay tree Rules Zig: Rotate the node about its parent (left or right). Zig_Zig: Rotate the parent about the grandparent (left or right), then rotate the node about its parent in the same direction. Zig_Zag: Rotate the node about its parent (left or right), then rotate the node about its grandparent in the other direction.
  • 5. Zig (Rotate Right): splay* RR_Rotate(splay* k2) { splay* k1 = k2->lchild; k2->lchild = k1->rchild; k1->rchild = k2; return k1; }
  • 6. Zig (Rotate Left): splay* LL_Rotate(splay* k2) { splay* k1 = k2->rchild; k2->rchild = k1->lchild; k1->lchild = k2; return k1; }
  • 7. Functions:  Insert  Delete  Search
  • 11. Insert (10) 5 10 It will move to the ROOT
  • 12. Insert (10) 10 5 5 is less than 10 and moved to left Now 10 is the ROOT
  • 14. Insert (15) 10 5 15 Now 15 will move to the ROOT
  • 15. Insert (15) 15 10 5 10 is less than 15 and moved to left 5 is less than 10 and moved to left
  • 16. Insert (12) 15 10 5 12
  • 17. Insert (12) 15 10 5 12 Now 12 will move to the place of 10
  • 18. Insert (12) 15 12 10 5 12 moved to the place of 10 10 is less than 12 and moved to left
  • 19. Insert (12) 15 12 10 5 12 will move to the ROOT
  • 20. Insert (12) 12 10 5 15 15 is greater than 12 and moved to the right
  • 21. Insert Implementation : splay* Insert(int key, splay* root) { static splay* p_node = NULL; if (!p_node) p_node = New_Node(key); else p_node->key = key; if (!root) { root = p_node; p_node = NULL; return root; } root = Splay(key, root);
  • 22. if (key < root->key) { p_node->lchild = root->lchild; p_node->rchild = root; root->lchild = NULL; root = p_node; } else if (key > root->key) { p_node->rchild = root->rchild; p_node->lchild = root; root->rchild = NULL; root = p_node; } else return root; p_node = NULL; return root; }
  • 24. Delete (4) from an existing tree 6 1 9 4 7 2
  • 25. Delete (4) from an existing tree 6 1 9 4 7 2 Now 4 is going to be the ROOT
  • 26. Delete (4) from an existing tree 4 4 is the root now 1 6 2 7 9
  • 27. Delete (4) from an existing tree  4 has been Deleted and the tree has splited into 2 parts 1 6 2 7 9
  • 28. Delete (4) from an existing tree 2 1 6 As (2) is the largest 9 element of the left sub tree, it will become the ROOT. 7
  • 29. Delete function Implementation: splay* Delete(int key, splay* root) { splay* temp; if (!root) return NULL; root = Splay(key, root); if (key != root->key) return root;
  • 30. else { if (!root->lchild) { temp = root; root = root->rchild; } else { temp = root; root = Splay(key, root->lchild); root->rchild = temp->rchild; } free(temp); return root; } }
  • 32. Find (10) 12 10 5 15
  • 33. Find (10) 12 10 5 15 10 will move to the ROOT
  • 34. Find (10) 10 5 10 is FOUND as it is the ROOT now ! 15 12 12 is greater than 10 and moved to right
  • 35. Zig-Zig 1 2 3 4 5 6 1 2 3 6 5 4 Find (6)
  • 36. 1 2 3 6 5 4 1 6 3 2 5 4 Find (6) zig-zig
  • 37. 1 6 3 2 5 4 6 1 3 2 5 4 Find (6) Zig
  • 38. Search function Implementation: splay* Search(int key, splay* root) { return Splay(key, root); }
  • 39. Splay function implementation: splay* Splay(int key, splay* root) { if (!root) return NULL; splay header; header.lchild = header.rchild = NULL; splay* LeftTreeMax = &header; splay* RightTreeMin = &header; while (1) { if (key < root->key) { if (!root->lchild) break; if (key < root->lchild->key) { root = RR_Rotate(root); if (!root->lchild) break; }
  • 40. RightTreeMin->lchild = root; RightTreeMin = RightTreeMin->lchild; root = root->lchild; RightTreeMin->lchild = NULL; } else if (key > root->key) { if (!root->rchild) break; if (key > root->rchild->key) { root = LL_Rotate(root); if (!root->rchild) break; } LeftTreeMax->rchild = root; LeftTreeMax = LeftTreeMax->rchild; root = root->rchild; LeftTreeMax->rchild = NULL; }
  • 41. else break; } LeftTreeMax->rchild = root->lchild; RightTreeMin->lchild = root->rchild; root->lchild = header.rchild; root->rchild = header.lchild; return root; }
  • 42. SPLAY TREE TIME COMPLEXITY Sorted List Search Insertion Deletion with arrays O(log n) O(n) O(n) with linked list O(n) O(n) O(n) With Splay trees O(log n) O(log n) O(log n)
  • 43. Splay Tree Usage  Memory allocators  Routers  Garbage collectors  Data compression
  • 44. Advantage :  Simple Implementation  Comparable performance  Small memory footprint  Working well with nodes containing identical keys Disadvantage:  Height can be linear  Extra management is needed if multiple threads are allowed to perform FIND operations.  Splay tree can be worse than Static tree.