Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // создание пустого дерева
- BinarySearchTree <int> iterativeTree;
- iterativeTree.iterativeInsert(10);
- iterativeTree.iterativeInsert(3);
- iterativeTree.iterativeInsert(20);
- iterativeTree.iterativeInsert(15);
- iterativeTree.iterativeInsert(30);
- iterativeTree.iterativeInsert(2);
- iterativeTree.iterativeInsert(5);
- iterativeTree.iterativeInsert(32);
- iterativeTree.iterativeInsert(22);
- // Вывод узлов дерева в выходной поток
- iterativeTree.print(cout);
- cout << "\n";
- BinarySearchTree <int> recursiveTree;
- recursiveTree.recursiveInsert(10);
- recursiveTree.recursiveInsert(3);
- recursiveTree.recursiveInsert(20);
- recursiveTree.recursiveInsert(15);
- recursiveTree.recursiveInsert(30);
- recursiveTree.recursiveInsert(2);
- recursiveTree.recursiveInsert(5);
- recursiveTree.recursiveInsert(32);
- recursiveTree.recursiveInsert(22);
- recursiveTree.print(cout);
- cout << "\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement