Note This is not an industry standard database application. I just made it for fun to improve my coding skills
This is an implementation of in memory database which uses AVL-Tree as its backend to store the data. The search, insert and delete operations work in O(log n) time where n represents the number of data points.
Property: AVL Tree is a self balancing binary search tree (BBST)
Property: The difference between the heights of left and right subtree is almost 1, aka balancing factor of a node.
It means that whenever the tree goes out of balance we perform rotations and make it balanced. All these rotations take constant amount of time, so there is no degradation in performance.
In worst case a binary search tree can be skewed as shown in the figure below. In such cases searching a data point can take O(n) time where n is the number of data points.
There are many of them, most used ones in industries for implementing databases are
- Clone the repository.
- Go to the directory and run
python cli.py
Please make a PR. I am always open to suggestions and constructive criticism.
