Status: Developing
⚠️
This project is an implementation of Binary Search Tree data structure along with some of its algorithms in Python.
This application is set to receive an input file consisting of sequential instructions to be executed. All supported instructions can be found at Files.
You should have Python 3.10.0 version installed on your computer.
All details about the code and its implementation:
The element to be stored in a tree.
- self.key - Integer number
- self.left - Reference to the left subtree
- self.right - Reference to the right subtree
The Binary Tree class is the one which most of elementary methods of a Binary Tree is implemented, such as traversals, isBinarySearchTree(), getSize() and findKthElement().
- self.root - Reference to the node element that is the root of the tree
All operations have to be written sequentially on the file instructions.txt.
The program will read each instruction at a time and execute it.
Operations suported:
- Insert [element]
- Remove [element]
- Search [element]
- FindKthElement [element]
- Size
- Traversals
- Pre-order
- In-order
- Post-order
- Level-order
Proper way to write on file:
OPERATION + WHITE_SPACE + ELEMENT
Instruction in CAPS followed by a white space and a number right after it if necessary.
Examples:
INSERT 20
This section will contain all the necessary information to run this application.
Features to be added to this project in the future:
- AVL Tree class.
- Support to read an input file consisting of ordered operations that the program must follow.
- More methods. For instance: median() and mean().
- Dedicated class to run the program.
MIT licensed.