Python icon indicating copy to clipboard operation
Python copied to clipboard

Add Splay Trees implantation ( Self Adjusting BST)

Open Prigoistic opened this issue 2 months ago • 2 comments

What would you like to share?

I was going through the repo, and i didnt find any implementation for Splay Trees, which is a very practical algorithm used in real world cases.

Current Status

The repository has AVL Tree, Red-Black Tree, and other balanced BSTs, but is missing Splay Tree which offers unique advantages for access locality.

Proposed Implementation

  • Complete Splay Tree class with all rotations (zig, zig-zig, zig-zag)
  • Standard BST operations (insert, delete, search, min, max)
  • Tree traversals (inorder, preorder)
  • Helper methods (size, height, display)
  • Comprehensive doctests
  • Performance demonstration

Benefits

  • Simpler implementation than other self-balancing trees
  • Excellent for scenarios with locality of reference
  • Amortized O(log n) performance
  • Educational value for algorithm learners

File Location

data_structures/binary_tree/splay_tree.py

Additional information

No response

Prigoistic avatar Oct 26 '25 07:10 Prigoistic

hey can you assign this issue to me...?

vivekkumarrathour avatar Oct 30 '25 09:10 vivekkumarrathour

I wanted to work on this issue please assign this issue to me.

ruheena-shaik avatar Oct 31 '25 10:10 ruheena-shaik