Skip to content

Commit 7908037

Browse files
authored
Update README.md
1 parent 2ae3d20 commit 7908037

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Binary Search Tree in Python
22

33
This project implements a Binary Search Tree (BST) in Python with basic operations:
4-
- Insert values (`append`)
4+
- Insert values
55
- Remove values (`remove_value`)
66
- Traversals (pre-order, in-order, post-order)
77
- Search for values
@@ -18,9 +18,9 @@ If you just want to try the tree without installing anything, copy **`tree.py`**
1818
from tree import Tree
1919

2020
tree = Tree()
21-
tree.append(5)
22-
tree.append(3)
23-
tree.append(7)
21+
tree.insert(5)
22+
tree.insert(3)
23+
tree.insert(7)
2424
tree.print_in_order()
2525
```
2626

@@ -43,9 +43,9 @@ Now you can import it anywhere:
4343
from bst import Tree
4444

4545
tree = Tree()
46-
tree.append(10)
47-
tree.append(4)
48-
tree.append(12)
46+
tree.insert(10)
47+
tree.insert(4)
48+
tree.insert(12)
4949
tree.print_in_order()
5050
```
5151

@@ -58,13 +58,13 @@ from bst import Tree
5858

5959
# Create tree and insert values
6060
test = Tree()
61-
test.append(5)
62-
test.append(8)
63-
test.append(6)
64-
test.append(9)
65-
test.append(3)
66-
test.append(4)
67-
test.append(2)
61+
test.insert(5)
62+
test.insert(8)
63+
test.insert(6)
64+
test.insert(9)
65+
test.insert(3)
66+
test.insert(4)
67+
test.insert(2)
6868

6969
# Remove values
7070
test.remove_value(5) # Removes root

0 commit comments

Comments
 (0)