prcpp - Binary Tree insert & remove implemented · platzhersh/FHNW-Java-Projekte@faf4f99 · GitHub
Skip to content

Commit faf4f99

Browse files
committed
prcpp - Binary Tree insert & remove implemented
1 parent 3391c0a commit faf4f99

5 files changed

Lines changed: 186 additions & 20 deletions

File tree

Lines changed: 65 additions & 0 deletions

prcpp/BinaryTree/BinaryTree.sdf

0 Bytes
Binary file not shown.
3 KB
Binary file not shown.

prcpp/BinaryTree/BinaryTree/BinaryTree.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,28 @@ int main(){
99
BinaryTreeNode *pb = new BinaryTreeNode(13);
1010
std::cout << pb->get_value() << std::endl;
1111

12-
BinaryTree t = BinaryTree(2);
13-
t.insert(1);
14-
t.insert(3);
12+
BinaryTree t = BinaryTree(50);
13+
t.insert(30);
14+
t.insert(20);
15+
t.insert(40);
16+
t.insert(80);
17+
t.insert(70);
18+
t.insert(90);
19+
t.insert(60);
20+
t.insert(100);
21+
t.insert(85);
22+
t.insert(101);
23+
t.insert(102);
24+
t.insert(103);
25+
t.insert(105);
26+
27+
std::cout << "DEBUG" << std::endl;
28+
t.remove(30);
29+
t.remove(20);
30+
31+
32+
33+
34+
return 0;
1535

1636
}

prcpp/BinaryTree/BinaryTree/BinaryTree.h

Lines changed: 98 additions & 17 deletions

0 commit comments

Comments
 (0)