https://github.com/stanislavkozlovski/red-black-tree
An extremely well tested and commented red black tree implementation. Worth a look if you are studying the material.
https://github.com/stanislavkozlovski/red-black-tree
hacktoberfest
Last synced: 11 months ago
JSON representation
An extremely well tested and commented red black tree implementation. Worth a look if you are studying the material.
- Host: GitHub
- URL: https://github.com/stanislavkozlovski/red-black-tree
- Owner: stanislavkozlovski
- Created: 2017-06-05T17:08:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-31T08:22:22.000Z (over 6 years ago)
- Last Synced: 2025-08-23T23:25:45.379Z (11 months ago)
- Topics: hacktoberfest
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 181
- Watchers: 3
- Forks: 48
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Red-Black-Tree
An extremely well tested and commented classic red black tree implementation. Worth a look if you are studying the material.
Supports
- addition
- deletion
Currently implemented in Python and Ruby
_These implementations can be found in my data structures repository.
The reason I created a separate repository for the tree is to enable people to find this easily.
I personally searched a lot through GitHub while learning about RB trees and did not manage to find code that was well commented and well tested.
I've tried to heavily describe each rotation and with 2000 lines of tests, I think it's descriptive enough_
# Note
Does not support duplicate values
# TODOs
- Rewrite tests for Ruby
- Write extra methods, like ceiling() and floor()