AVLTree: forward LeftMost and RightMost method from AVLTreeBase
Signed-off-by: Augustin Cavalier <[email protected]>
This commit is contained in:
@@ -47,6 +47,9 @@ public:
|
||||
Value* Previous(Value* value) const;
|
||||
Value* Next(Value* value) const;
|
||||
|
||||
Value* LeftMost(Value* value) const;
|
||||
Value* RightMost(Value* value) const;
|
||||
|
||||
inline Iterator GetIterator();
|
||||
inline ConstIterator GetIterator() const;
|
||||
|
||||
@@ -255,6 +258,30 @@ AVLTree<Definition>::Next(Value* value) const
|
||||
}
|
||||
|
||||
|
||||
template<typename Definition>
|
||||
inline typename AVLTree<Definition>::Value*
|
||||
AVLTree<Definition>::LeftMost(Value* value) const
|
||||
{
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
|
||||
AVLTreeNode* node = fTree.LeftMost(_GetAVLTreeNode(value));
|
||||
return node != NULL ? _GetValue(node) : NULL;
|
||||
}
|
||||
|
||||
|
||||
template<typename Definition>
|
||||
inline typename AVLTree<Definition>::Value*
|
||||
AVLTree<Definition>::RightMost(Value* value) const
|
||||
{
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
|
||||
AVLTreeNode* node = fTree.RightMost(_GetAVLTreeNode(value));
|
||||
return node != NULL ? _GetValue(node) : NULL;
|
||||
}
|
||||
|
||||
|
||||
template<typename Definition>
|
||||
inline typename AVLTree<Definition>::Iterator
|
||||
AVLTree<Definition>::GetIterator()
|
||||
|
||||
Reference in New Issue
Block a user