Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "binary_tree.h"
- #include <iostream>
- #include <vector>
- #include <ostream>
- #include <cmath>
- /*
- * transplant
- * find place to add
- */
- class MyClass{
- public:
- int value;
- MyClass(){
- value = 0;
- }
- MyClass(const int& new_value){
- value = new_value;
- }
- bool operator<(MyClass& arg) const{
- return value < arg.value;
- }
- };
- int main()
- {
- BinaryTree<MyClass> tree;
- tree.push(MyClass(3));
- tree.push(MyClass(4));
- tree.push(MyClass(2));
- const MyClass min = tree.min();
- std::cout << min.value << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement