Files
DataStruct/main.cpp
2024-06-30 14:50:16 +08:00

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;
}