-
-
Couldn't load subscription status.
- Fork 49.1k
Open
Labels
awaiting triageAwaiting triage from a maintainerAwaiting triage from a maintainer
Description
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
Metadata
Metadata
Assignees
Labels
awaiting triageAwaiting triage from a maintainerAwaiting triage from a maintainer