61 template <
class Element >
63 template <
class Element >
68 template <
typename Element >
73 template <
typename Element >
90 template <
class Element >
277 template <
class Element >
340 const Element&
operator[](
const unsigned int i)
const;
381 void insert(
const Element& e);
423 bool contains(
const Element& e)
const;
The class for generic Hash Tables.
SplayBinaryNode * fg
The left child.
SplayBinaryNode< Element > * zag()
A left rotation, the node must hava a father.
const Element & getElement() const
Returns the element in the node.
SplayBinaryNode(const Element &e, HashTable< Element, SplayBinaryNode< Element > * > &addr, SplayBinaryNode *g=0, SplayBinaryNode *d=0, SplayBinaryNode *p=0)
Basic constructor: creates a node with a reference to the element.
int position() const
Position of the node.
SplayBinaryNode * pere
The father, nullptr for the root.
void copy_(const SplayBinaryNode< Element > &from, HashTable< Element, SplayBinaryNode< Element > * > &addr)
A function used to perform copies.
SplayBinaryNode * fd
The right child.
const SplayBinaryNode< Element > * getFg() const
Returns the left child.
~SplayBinaryNode()
Class destructor.
SplayBinaryNode< Element > * join(const SplayBinaryNode< Element > *e, HashTable< Element, SplayBinaryNode< Element > * > &addr)
Concatenation of two trees.
SplayBinaryNode< Element > * splay()
A splay rotation, the node will be the root of the tree.
const SplayBinaryNode< Element > * getFd() const
Returns the right child.
SplayBinaryNode< Element > * zig()
A right rotation, the node must have a father.
Size size
The size of the sub-tree.
Element & operator[](const unsigned int i)
Get the element at the position n.
Element & front()
Get the first element.
~SplayTree()
Class destructor.
void pushFront(const Element &e)
Add an element in the first position.
bool contains(const Element &e) const
Test if the tree contains the element.
SplayBinaryNode< Element > * root
Root of the tree.
SplayTree()
Basic constructor, make an empty splay tree.
void popBack()
Remove the last element.
void popFront()
Remove the first element.
Size size() const
The number of elements in the tree.
SplayTree< Element > & operator=(const SplayTree< Element > &from)
Assignment operator.
Element & back()
Get the last element.
void join(const SplayTree< Element > &s)
Concatenation of two trees.
HashTable< Element, SplayBinaryNode< Element > * > addr
The hash table to find quickly the position of a node.
SplayTree< Element > split(const int i)
Divide the tree at the position.
void copy_(const SplayTree< Element > &)
a function used to perform copies
void insert(const Element &e)
Add an element to the tree.
void pushBack(const Element &e)
Add an element in the last position.
SplayTree< Element > split_by_val(const Element &e)
Divide the tree at the position.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Class hash tables iterators.
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
Template implementation of splay trees.