https://github.com/ivanbgd/self-balancing-binary-search-trees
Self-Balancing Binary Search Trees (AVL, Splay), with examples
https://github.com/ivanbgd/self-balancing-binary-search-trees
avl avl-tree avltree binary-search-tree bst splay splay-trees splaytrees
Last synced: about 2 months ago
JSON representation
Self-Balancing Binary Search Trees (AVL, Splay), with examples
- Host: GitHub
- URL: https://github.com/ivanbgd/self-balancing-binary-search-trees
- Owner: ivanbgd
- License: mit
- Created: 2017-11-13T03:37:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T05:12:42.000Z (over 7 years ago)
- Last Synced: 2025-02-03T10:11:56.541Z (3 months ago)
- Topics: avl, avl-tree, avltree, binary-search-tree, bst, splay, splay-trees, splaytrees
- Language: Python
- Size: 50.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Self-Balancing-Binary-Search-Trees
Self-Balancing Binary Search Trees (AVL, Splay), with examplesRegular, non-balancing, BSTs are also included.
Available operations on trees include traversals (in-order, pre-order, post-order, level-order, both recursive and iterative), search, finding minimum and maximum values, range search (which returns a list of nodes with keys between two values), insertion, deletion, merging two trees, splitting a tree in two trees, order statistic (returning the k-th smallest element in a tree), computing rank of a node, and printing a tree.
Color flips are a way of representing arrays by using BSTs, for improved speed of operation.
By using AVL trees like here (self balancing trees in general), we keep the maximum height of a tree at O(log n), so all operations on the array take at most O(log n) time.