File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ ![ Open Source Love] ( https://badges.frapsoft.com/os/v1/open-source.svg?v=103 )
2
+
3
+ # Binary Search Tree
4
+ - Differ from a regular Binary Tree because of one key property: Nodes must be arranged in order
5
+ - the node's left subtree must have values less than the node
6
+ - the node's right subtree must have values greater than the node
7
+ - this is going based on that every value in the BST must be unique
8
+
9
+ # Functions Implemented
10
+ - Init
11
+ - tree = BST(1,None,None) _ creates a tree with one node_
12
+ - A basic constructor that creates a BST with three parameters
13
+ - BST(value,left_subtree,right_subtree)
14
+ - Add
15
+ - tree.add(4) _ adds 4 to our previous tree created, giving a right child_
16
+ - Maintains BST properties by adding to either subtree depending on the value
17
+ - returns a string telling if insertion was or wasn't successful
18
+ - Remove
19
+ - tree.remove(1) _ removes 1 from our current tree, resulting 4 to be the sole node_
20
+ - Maintains BST properties by restructuring the tree when we remove the value
21
+ - returns a string telling if deletion was or wasn't successful
22
+ # Author
23
+ [ Tomas Urdinola] ( https://github.com/tomurdi )
You can’t perform that action at this time.
0 commit comments