26 lines
565 B
C++
26 lines
565 B
C++
#include <iostream>
|
|
#include <RedBlackTree.h>
|
|
|
|
|
|
class RedBlackTree : public ling::RedBlackTree<int> {
|
|
protected:
|
|
[[nodiscard]] ling::Relation equal(const int &val1, const int &val2) const override {
|
|
if (val1 == val2)
|
|
return ling::Relation::EQUAL;
|
|
if (val1 < val2)
|
|
return ling::Relation::SMALL;
|
|
return ling::Relation::BIG;
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
RedBlackTree tree;
|
|
|
|
for (int i = 0; i < 400000; i++)
|
|
tree.insert(i);
|
|
|
|
std::cout << "Max : " << tree.maximum()->value << std::endl;
|
|
|
|
return 0;
|
|
}
|