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.
const Element & getElement() const
Returns the element in the node.
void copy_(const SplayBinaryNode< Element > &from, HashTable< Element, SplayBinaryNode< Element > * > &addr)
A function used to perform copies.
SplayBinaryNode< Element > * zag()
A left rotation, the node must have a father.
int position() const
Position of the node.
SplayBinaryNode * pere
The father, nullptr for the root.
const SplayBinaryNode< Element > * getFd() const
Returns the right child.
SplayBinaryNode * fd
The right child.
const SplayBinaryNode< Element > * getFg() const
Returns the left child.
SplayBinaryNode< Element > * join(const SplayBinaryNode< Element > *e, HashTable< Element, SplayBinaryNode< Element > * > &addr)
Concatenation of two trees.
SplayBinaryNode< Element > * zig()
A right rotation, the node must have a father.
~SplayBinaryNode()
Class destructor.
SplayBinaryNode< Element > * splay()
A splay rotation, the node will be the root of the tree.
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.
Size size
The size of the sub-tree.
void pushBack(const Element &e)
Add an element in the last position.
Element & operator[](const unsigned int i)
Get the element at the position n.
void popBack()
Remove the last element.
Element & front()
Get the first element.
bool contains(const Element &e) const
Test if the tree contains the element.
~SplayTree()
Class destructor.
SplayBinaryNode< Element > * root
Root of the tree.
void pushFront(const Element &e)
Add an element in the first position.
SplayTree< Element > & operator=(const SplayTree< Element > &from)
Assignment operator.
void join(const SplayTree< Element > &s)
Concatenation of two trees.
SplayTree()
Basic constructor, make an empty splay tree.
void insert(const Element &e)
Add an element to the tree.
void copy_(const SplayTree< Element > &)
a function used to perform copies
Element & back()
Get the last element.
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 popFront()
Remove the first element.
SplayTree< Element > split_by_val(const Element &e)
Divide the tree at the position.
Size size() const
The number of elements in the tree.
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.