Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar08 / src / BST / tests.cpp
diff options
context:
space:
mode:
Commit981037e28374f8c4ab44e26bdeda62da59f21a21 (patch)
Author
 Stoycho Kyosev <stoycho.kk@gmail.com>
2024-12-04 17:15:45 -0500
Committer
 Stoycho Kyosev <stoycho.kk@gmail.com>
2024-12-04 17:15:45 -0500
Files8e4caeb3663627ac318a839efa217216cc21f8b2 /Seminar08/src/BST/tests.cpp
Data-structures-and-algorithms-981037e28374f8c4ab44e26bdeda62da59f21a21.tar
Data-structures-and-algorithms-981037e28374f8c4ab44e26bdeda62da59f21a21.tar.gz
Data-structures-and-algorithms-981037e28374f8c4ab44e26bdeda62da59f21a21.zip
Parent36a5f76137ee642768e828ace30359c5e468aa10 (diff)
Add sem08
1 files changed, 28 insertions, 0 deletions
-rw-r--r--Seminar08/src/BST/tests.cpp28
diff --git a/Seminar08/src/BST/tests.cpp b/Seminar08/src/BST/tests.cpp
new file mode 100644
index 0000000..e1ba15e
--- /dev/null
+++ b/Seminar08/src/BST/tests.cpp
@@ -0,0 +1,28 @@
+#include "indexable-bst.hpp"
+
+int main()
+{
+ Bst<int> bst;
+
+ for (size_t i = 0; i < 100; i++)
+ {
+ bst.insert(i);
+ }
+
+ for (size_t i = 0; i < bst.getSize(); i++)
+ {
+ std::cout << bst.index(i) << " ";
+ }
+
+ std::cout << std::endl;
+
+ for (size_t i = 0; i < 50; i++)
+ {
+ bst.remove(i);
+ }
+
+ for (size_t i = 0; i < bst.getSize(); i++)
+ {
+ std::cout << bst.index(i) << " ";
+ }
+} \ No newline at end of file