mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
AK: Add RedBlackTree::find_largest_not_above_iterator
It's a version of find_largest_not_above that returns an iterator.
This commit is contained in:
parent
98a774a68d
commit
d26f4f9e8c
1 changed files with 6 additions and 0 deletions
|
@ -464,6 +464,12 @@ public:
|
|||
ConstIterator end() const { return {}; }
|
||||
ConstIterator begin_from(K key) const { return ConstIterator(static_cast<Node*>(BaseTree::find(this->m_root, key))); }
|
||||
|
||||
ConstIterator find_largest_not_above_iterator(K key) const
|
||||
{
|
||||
auto node = static_cast<Node*>(BaseTree::find_largest_not_above(this->m_root, key));
|
||||
return ConstIterator(node, static_cast<Node*>(BaseTree::predecessor(node)));
|
||||
}
|
||||
|
||||
V unsafe_remove(K key)
|
||||
{
|
||||
auto* node = BaseTree::find(this->m_root, key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue