tlx
|
#include <splay_tree.hpp>
Classes | |
struct | Node |
splay tree node, also seen as public iterator More... | |
Public Member Functions | |
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. More... | |
bool | erase (const Key &k) |
erase key from tree, return true if it existed. More... | |
bool | erase (const Node *n) |
erase node from tree, return true if it existed. More... | |
void | clear () |
free all nodes More... | |
bool | exists (const Key &k) |
check if key exists More... | |
size_t | size () const |
return number of items in tree More... | |
bool | empty () const |
return true if tree is empty More... | |
Node * | find (const Key &k) |
find tree node containing key or return smallest key larger than k More... | |
bool | check () const |
check the tree order More... | |
template<typename Functor > | |
void | traverse_preorder (const Functor &f) const |
traverse the whole tree in preorder (key order)s More... | |
Private Types | |
typedef Allocator::template rebind< Node >::other | node_alloc_type |
node allocator More... | |
Private Member Functions | |
void | delete_node (Node *n) |
delete node More... | |
Private Attributes | |
Node * | root_ |
root tree node More... | |
size_t | size_ |
number of items in tree container More... | |
Compare | cmp_ |
key comparator More... | |
Allocator | alloc_ |
key allocator More... | |
node_alloc_type | node_allocator_ |
node allocator More... | |
Definition at line 223 of file splay_tree.hpp.
|
private |
node allocator
Definition at line 320 of file splay_tree.hpp.
|
inlineexplicit |
Definition at line 233 of file splay_tree.hpp.
|
inlineexplicit |
Definition at line 236 of file splay_tree.hpp.
|
inline |
Definition at line 239 of file splay_tree.hpp.
|
inline |
check the tree order
Definition at line 299 of file splay_tree.hpp.
|
inline |
free all nodes
Definition at line 273 of file splay_tree.hpp.
|
inlineprivate |
delete node
Definition at line 326 of file splay_tree.hpp.
|
inline |
return true if tree is empty
Definition at line 289 of file splay_tree.hpp.
|
inline |
erase key from tree, return true if it existed.
Definition at line 260 of file splay_tree.hpp.
|
inline |
erase node from tree, return true if it existed.
Definition at line 268 of file splay_tree.hpp.
|
inline |
check if key exists
Definition at line 278 of file splay_tree.hpp.
|
inline |
find tree node containing key or return smallest key larger than k
Definition at line 294 of file splay_tree.hpp.
|
inline |
insert key into tree if it does not exist, returns true if inserted.
Definition at line 244 of file splay_tree.hpp.
|
inline |
return number of items in tree
Definition at line 284 of file splay_tree.hpp.
|
inline |
traverse the whole tree in preorder (key order)s
Definition at line 305 of file splay_tree.hpp.
|
private |
key allocator
Definition at line 317 of file splay_tree.hpp.
|
private |
key comparator
Definition at line 315 of file splay_tree.hpp.
|
private |
node allocator
Definition at line 323 of file splay_tree.hpp.
|
private |
root tree node
Definition at line 311 of file splay_tree.hpp.
|
private |
number of items in tree container
Definition at line 313 of file splay_tree.hpp.