|
| SplayTree (Allocator alloc=Allocator()) |
|
| SplayTree (Compare cmp, Allocator alloc=Allocator()) |
|
| ~SplayTree () |
|
bool | insert (const Key &k) |
| insert key into tree if it does not exist, returns true if inserted.
|
|
bool | erase (const Key &k) |
| erase key from tree, return true if it existed.
|
|
bool | erase (const Node *n) |
| erase node from tree, return true if it existed.
|
|
void | clear () |
| free all nodes
|
|
bool | exists (const Key &k) |
| check if key exists
|
|
size_t | size () const |
| return number of items in tree
|
|
bool | empty () const |
| return true if tree is empty
|
|
Node * | find (const Key &k) |
| find tree node containing key or return smallest key larger than k
|
|
bool | check () const |
| check the tree order
|
|
template<typename Functor > |
void | traverse_preorder (const Functor &f) const |
| traverse the whole tree in preorder (key order)s
|
|
template<typename Key, typename Compare = std::less<Key>, bool Duplicates = false, typename Allocator = std::allocator<Key>>
class tlx::SplayTree< Key, Compare, Duplicates, Allocator >
Definition at line 223 of file splay_tree.hpp.
template<typename Key , typename Compare = std::less<Key>, bool Duplicates = false, typename Allocator = std::allocator<Key>>
bool erase |
( |
const Key & |
k | ) |
|
|
inline |
erase key from tree, return true if it existed.
Definition at line 260 of file splay_tree.hpp.
template<typename Key , typename Compare = std::less<Key>, bool Duplicates = false, typename Allocator = std::allocator<Key>>
bool erase |
( |
const Node * |
n | ) |
|
|
inline |
erase node from tree, return true if it existed.
Definition at line 268 of file splay_tree.hpp.
template<typename Key , typename Compare = std::less<Key>, bool Duplicates = false, typename Allocator = std::allocator<Key>>
bool insert |
( |
const Key & |
k | ) |
|
|
inline |
insert key into tree if it does not exist, returns true if inserted.
Definition at line 244 of file splay_tree.hpp.
template<typename Key , typename Compare = std::less<Key>, bool Duplicates = false, typename Allocator = std::allocator<Key>>
template<typename Functor >
void traverse_preorder |
( |
const Functor & |
f | ) |
const |
|
inline |
traverse the whole tree in preorder (key order)s
Definition at line 305 of file splay_tree.hpp.