/pyBST

python implement of naive binary search tree and red-black tree

Primary LanguagePythonMIT LicenseMIT

Getting Started

#compare performence of naive binary seach tree and red-black tree
python3 test_bst_rbt.py

red-black tree is faster than naive binary seach tree , expected result like this:

It takes 58.83s for binary_search_tree init
It takes 0.52s for red_black_tree init
Founded
It takes 0.000083s for query 5000 in binary_search_tree
Founded
It takes 0.000026s for query 5000 in red_black_tree