Lovelly bug in Interval Tree

This commit is contained in:
IlyaShurupov 2024-10-08 14:39:30 +03:00
parent e3757770c8
commit 450a816b2b
2 changed files with 8 additions and 3 deletions

View file

@ -2,6 +2,8 @@
#include "Tree.hpp"
#include <limits>
namespace tp {
template <typename tType>
@ -31,7 +33,7 @@ namespace tp {
template <typename tTreeNodeType>
inline void updateNodeCache(const tTreeNodeType* node) {
mMax = 0;
mMax = std::numeric_limits<tType>::min();
if (node->mRight && node->mRight->key.mMax > mMax) mMax = node->mRight->key.mMax;
if (node->mLeft && node->mLeft->key.mMax > mMax) mMax = node->mLeft->key.mMax;
if (mMax < mEnd) mMax = mEnd;