Aleph-w  1.9
General library for algorithms and data structures
tpl_dynSetTree.H
1 
2 /* Aleph-w
3 
4  / \ | | ___ _ __ | |__ __ __
5  / _ \ | |/ _ \ '_ \| '_ \ ____\ \ /\ / / Data structures & Algorithms
6  / ___ \| | __/ |_) | | | |_____\ V V / version 1.9b
7  /_/ \_\_|\___| .__/|_| |_| \_/\_/ https://github.com/lrleon/Aleph-w
8  |_|
9 
10  This file is part of Aleph-w library
11 
12  Copyright (c) 2002-2018 Leandro Rabindranath Leon & Alejandro Mujica
13 
14  This program is free software: you can redistribute it and/or modify
15  it under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27 
28 # ifndef TPL_DYNSETTREE_H
29 # define TPL_DYNSETTREE_H
30 
31 # include <typeinfo>
32 # include <ah-args-ctor.H>
33 # include <ahIterator.H>
34 # include <tpl_binNodeUtils.H>
35 # include <tpl_binNodeXt.H>
36 # include <tpl_binTree.H>
37 # include <tpl_treap.H>
38 # include <tpl_treapRk.H>
39 # include <tpl_avl.H>
40 # include <tpl_rand_tree.H>
41 # include <tpl_rb_tree.H>
42 //# include <tpl_tdRbTree.H>
43 # include <tpl_splay_tree.H>
44 
45 using namespace Aleph;
46 
47 namespace Aleph {
48 
58  template <typename Key,
59  template <typename, class> class Tree = Avl_Tree,
60  class Compare = Aleph::less<Key>>
62  : public LocateFunctions<DynSetTree<Key, Tree, Compare>, Key>,
63  public FunctionalMethods<DynSetTree<Key, Tree, Compare>, Key>,
64  public GenericKeys<DynSetTree<Key, Tree, Compare>, Key>,
65  public EqualToMethod<DynSetTree<Key, Tree, Compare>>,
66  public StlAlephIterator<DynSetTree<Key, Tree, Compare>>
67 {
68 public:
69 
72  using Node = typename Tree<Key, Compare>::Node;
73 
74  using Tree_Type = Tree<Key, Compare>;
75 
76 private:
77 
78  static const size_t dim = 13;
79 
80  mutable Tree<Key, Compare> tree;
81  size_t num_nodes;
82 
83 public:
84 
85  typedef DynSetTree Set_Type;
86 
87  typedef Key Item_Type;
88 
89  typedef Key Key_Type;
90 
96  void swap(DynSetTree & dset)
97  {
98  tree.swap(dset.tree);
99  std::swap(num_nodes, dset.num_nodes);
100  }
101 
103  DynSetTree(Compare cmp = Compare())
104  : tree(cmp), num_nodes(0)
105  {
106  /* empty */
107  }
108 
110  DynSetTree(const DynSetTree & srcTree)
111  : tree(srcTree.tree.get_compare()), num_nodes(srcTree.num_nodes)
112  {
113  Node * srcRoot = srcTree.tree.getRoot();
114  try
115  {
116  tree.getRoot() = copyRec(srcRoot);
117  }
118  catch (...)
119  {
120  num_nodes = 0;
121  throw;
122  }
123  }
124 
125  Special_Ctors(DynSetTree, Key);
126 
127  DynSetTree(DynSetTree && srcTree) : num_nodes(0)
128  {
129  swap(srcTree);
130  }
131 
133  void empty()
134  {
135  destroyRec(tree.getRoot());
136  num_nodes = 0;
137  }
138 
139  DynSetTree & operator = (const DynList<Key> & list)
140  {
141  return *this = DynSetTree(list);
142  }
143 
145  DynSetTree & operator = (const DynSetTree & srcTree)
146  {
147  if (this == &srcTree)
148  return *this;
149 
150  Node *src_root = (Node*) const_cast<DynSetTree&>(srcTree).tree.getRoot();
151 
152  empty();
153 
154  tree.getRoot() = copyRec(src_root);
155  num_nodes = srcTree.num_nodes;
156 
157  return *this;
158  }
159 
161  DynSetTree & operator = (DynSetTree && srcTree)
162  {
163  swap(srcTree);
164  return *this;
165  }
166 
168  virtual ~DynSetTree()
169  {
170  empty();
171  }
172 
173 private:
174 
175  Key * __insert(Node * p)
176  {
177  if (tree.search_or_insert(p) != p)
178  return nullptr;
179 
180  ++num_nodes;
181 
182  return &p->get_key();
183  }
184 
185 public:
186 
195  Key * insert(const Key & key)
196  {
197  return __insert(new Node(key));
198  }
199 
200  Key * insert(Key && key)
201  {
202  return __insert(new Node(std::forward<Key>(key)));
203  }
204 
205  Key * append(const Key & key)
206  {
207  return insert(key);
208  }
209 
210  Key * append(Key && key)
211  {
212  return insert(std::forward<Key>(key));
213  }
214 
215 private:
216 
217  Key * __search_or_insert(Node * p)
218  {
219  Node * q = tree.search_or_insert(p);
220  if (q != p)
221  delete p;
222  else
223  ++num_nodes;
224 
225  return &q->get_key();
226  }
227 
228  pair<Node*, bool> __contains_or_insert(Node * p)
229  {
230  Node * q = tree.search_or_insert(p);
231  if (q != p)
232  { // KEY(p) is already inside the tree
233  delete p;
234  return pair<Node*, bool>(q, true);
235  }
236  ++num_nodes;
237  return pair<Node*, bool>(p, false);
238  }
239 
240 public:
241 
254  Key * search_or_insert(const Key & key)
255  {
256  return __search_or_insert(new Node(key));
257  }
258 
259  Key * search_or_insert(Key && key)
260  {
261  return __search_or_insert(new Node(std::forward<Key>(key)));
262  }
263 
264  /* Busca la clave <code>key</code> en el árbol binario de búsqueda y
265  eventualmente lo inserta en caso de no encontrarse.
266 
267  <code>contains_or_insert(key)</code> busca en el árbol la clave
268  <code>key</code>. Si la clave ya se encuentra, entonces se retorna
269  true. De lo contrario la clave es insertada y se retorna false.
270 
271  @param[in] key clave a encontrar o a insertar
272  @return a pair whose first field is a pointer to the found or
273  inserted key and the second field is a boolean whose value is
274  `false` if the key was inserted; `true` otherwise, that is if the
275  key is already present in the tree.
276  */
277  pair<Key*, bool> contains_or_insert(const Key & key)
278  {
279  auto p = __contains_or_insert(new Node(key));
280  return pair<Key*, bool>(&p.first->get_key(), p.second);
281  }
282 
283  pair<Key*, bool> contains_or_insert(Key && key)
284  {
285  auto p = __contains_or_insert(new Node(std::forward<Key>(key)));
286  return pair<Key*, bool>(&p.first->get_key(), p.second);
287  }
288 
289 private:
290 
291  Key * __insert_dup(Node * q)
292  {
293  Node * p = tree.insert_dup(q);
294  ++num_nodes;
295  return &p->get_key();
296  }
297 
298 public:
299 
300  Key * insert_dup(const Key & key)
301  {
302  return __insert_dup(new Node(key));
303  }
304 
305  Key * insert_dup(Key && key)
306  {
307  return __insert_dup(new Node(std::forward<Key>(key)));
308  }
309 
310  Key * put(const Key & key)
311  {
312  return insert(key);
313  }
314 
315  Key * put(Key && key)
316  {
317  return insert(std::forward<Key>(key));
318  }
319 
327  size_t remove(const Key & key)
328  {
329  Node * p = static_cast<Node*>(tree.remove(key));
330 
331  if (p == nullptr)
332  return num_nodes;
333 
334  delete p;
335 
336  return --num_nodes;
337  }
338 
349  Key del(const Key & key)
350  {
351  Node * p = static_cast<Node*>(tree.remove(key));
352 
353  if (p == nullptr)
354  throw domain_error("DynSetTree::del key is not found in the tree");
355 
356  auto ret_val = p->get_key();
357 
358  delete p;
359 
360  --num_nodes;
361 
362  return ret_val;
363  }
364 
372  Key remove_pos(const size_t i)
373  {
374  Node * p = static_cast<Node*>(tree.remove_pos(i));
375  const Key ret_val = KEY(p);
376 
377  delete p;
378 
379  --num_nodes;
380 
381  return ret_val;
382  }
383 
385  bool exist(const Key & key) const
386  {
387  return const_cast<DynSetTree&>(*this).search(key) != nullptr;
388  }
389 
390  bool has(const Key & key) const
391  {
392  return exist(key);
393  }
394 
395  bool contains(const Key & key) const
396  {
397  return exist(key);
398  }
399 
414  Key & find(const Key & key) const
415  {
416  Node * node = static_cast<Node*>(tree.search(key));
417 
418  if (node == nullptr)
419  throw std::domain_error("key not found");
420 
421  return node->get_key();
422  }
423 
438  std::pair<int, Key*> find_position(const Key & key) const
439  {
440  if (num_nodes == 0)
441  return std::pair<int, Key*> (0, nullptr);
442 
443  std::pair<int, Node*> p = tree.find_position(key);
444 
445  return std::pair<int, Key*> (p.first, &p.second->get_key());
446  }
447 
462  Key * search(const Key & key) const
463  {
464  Node * node = static_cast<Node*>(tree.search(key));
465 
466  if (node == nullptr)
467  return nullptr;
468 
469  return &(node->get_key());
470  }
471 
474  const Key & min() const
475  {
476  if (num_nodes == 0)
477  throw std::domain_error("set is empty");
478 
479  return find_min(tree.getRoot())->get_key();
480  }
481 
483  const Key & get_first() const { return min(); }
484 
487  const Key & max() const
488  {
489  if (num_nodes == 0)
490  throw std::domain_error("set is empty");
491 
492  return find_max(tree.getRoot())->get_key();
493  }
494 
496  const Key & get_last() const { return max(); }
497 
499  const Key & get() const { return max(); }
500 
502  const size_t & size() const { return num_nodes; }
503 
505  bool is_empty() const { return num_nodes == 0; }
506 
509  size_t internal_path_length() const
510  {
511  return Aleph::internal_path_length(tree.getRoot());
512  }
513 
514  Node * get_root_node() const { return tree.getRoot(); }
515 
516  const Key & get_root() const
517  {
518  if (num_nodes == 0)
519  throw std::domain_error("Tree is empty");
520  return KEY(tree.getRoot());
521  }
522 
524  const Key & get_item() const { return get_root(); }
525 
527  size_t height() const { return computeHeightRec(tree.getRoot()); }
528 
531  template <class Op>
532  void for_each_in_preorder(void (*visitFct)(Node*, int, int))
533  {
534  Node * root = static_cast<Node*>(tree.getRoot());
535  preOrderRec(root, visitFct);
536  }
537 
550  long position(const Key & key) const
551  {
552  std::pair<long, Node*> p = tree.position(key);
553  return p.first;
554  }
555 
561  Key & select(const size_t & i)
562  {
563  return tree.select(i)->get_key();
564  }
565 
566  const Key & select(const size_t & i) const
567  {
568  return tree.select(i)->get_key();
569  }
570 
571  Key & operator () (const size_t & i)
572  {
573  return select(i);
574  }
575 
576  const Key & operator [] (const Key & key) const
577  {
578  return find(key);
579  }
580 
581  const Key & operator [] (const Key & key)
582  {
583  return *search_or_insert(key);
584  }
585 
586  Key & access (const size_t & i)
587  {
588  return select(i);
589  }
590 
591  bool verify()
592  {
593  return tree.verify() and check_bst(tree.getRoot());
594  }
595 
596 private:
597 
598  template <class Key_Op>
599 struct Node_Op
600 {
601  Key_Op & key_op;
602 
603  Node_Op(Key_Op & __key_op) : key_op(__key_op) { /* empty */ }
604 
605  Node_Op(Key_Op && __key_op) : key_op(__key_op)
606  {
607  /* empty */
608  }
609 
610  void operator () (Node * root)
611  {
612  assert(root != nullptr);
613  key_op(KEY(root));
614  }
615 };
616 
617 public:
618 
643  template <class Key_Op>
644  void for_each_preorder(Key_Op & key_op) const
645  {
646  Node * root = (Node *) tree.getRoot();
647 
648  Node_Op <Key_Op> node_op(const_cast<Key_Op&>(key_op));
649 
650  For_Each_Preorder<Node> () (root, node_op);
651  }
652 
654  template <class Key_Op>
655  void for_each_preorder(Key_Op && key_op = Key_Op()) const
656  {
657  for_each_preorder<Key_Op>(key_op);
658  }
659 
684  template <class Key_Op>
685  void for_each_inorder(Key_Op & key_op) const
686  {
687  Node * root = (Node *) tree.getRoot();
688 
689  Node_Op <Key_Op> node_op(const_cast<Key_Op&>(key_op));
690 
691  For_Each_In_Order<Node> () (root, node_op);
692  }
693 
695  template <class Key_Op>
696  void for_each_inorder(Key_Op && key_op = Key_Op()) const
697  {
698  for_each_inorder<Key_Op>(key_op);
699  }
700 
725  template <class Key_Op>
726  void for_each_postorder(Key_Op & key_op)
727  {
728  Node * root = (Node *) tree.getRoot();
729 
730  Node_Op <Key_Op> node_op(const_cast<Key_Op&>(key_op));
731 
732  For_Each_Postorder<Node> () (root, node_op);
733  }
734 
736  template <class Key_Op>
737  void for_each_postorder(Key_Op && key_op = Key_Op())
738  {
739  for_each_postorder<Key_Op>(key_op);
740  }
741 
758  {
759  tree.join(t.tree, dup.tree);
760  return *this;
761  }
762 
765  {
766  return join(t, dup);
767  }
768 
782  {
783  tree.join_dup(t.tree);
784  t.num_nodes = 0;
785  t.tree.getRoot() = Node::NullPtr;
786  num_nodes = COUNT(tree.getRoot());
787  return *this;
788  }
789 
805  bool split_key(const Key & key, DynSetTree & l, DynSetTree & r)
806  {
807  if (not tree.split_key(key, l.tree, r.tree))
808  return false;
809 
810  tree.getRoot() = Node::NullPtr;
811  num_nodes = 0;
812  l.num_nodes = COUNT(l.tree.getRoot());
813  r.num_nodes = COUNT(r.tree.getRoot());
814 
815  return true;
816  }
817 
831  void split_pos(const size_t pos, DynSetTree & l, DynSetTree & r)
832  {
833  tree.split_pos(pos, l.tree, r.tree);
834  num_nodes = 0;
835  l.num_nodes = COUNT(l.tree.getRoot());
836  r.num_nodes = COUNT(r.tree.getRoot());
837  }
838 
851  void split_key_dup(const Key & key, DynSetTree & l, DynSetTree & r)
852  {
853  tree.split_key_dup(key, l.tree, r.tree);
854  tree.getRoot() = Node::NullPtr;
855  num_nodes = 0;
856  l.num_nodes = COUNT(l.tree.getRoot());
857  r.num_nodes = COUNT(r.tree.getRoot());
858  }
859 
860  struct Iterator : public Tree_Type::Iterator
861  {
862  using Base = typename Tree_Type::Iterator;
863 
864  using Set_Type = DynSetTree;
865 
866  Iterator(const DynSetTree & tree) : Base(tree.tree) { /* empty */ }
867 
868  const Key & get_curr_ne() const noexcept
869  {
870  return Base::get_curr_ne()->get_key();
871  }
872 
873  Key & get_curr_ne() noexcept { return Base::get_curr_ne()->get_key(); }
874 
875  const Key & get_curr() const { return Base::get_curr()->get_key(); }
876 
877  Key & get_curr() { return Base::get_curr()->get_key(); }
878  };
879 
894  template <class Operation>
895  bool traverse(Operation & op)
896  {
897  return Aleph::traverse(tree.getRoot(), [&op] (Node * p)
898  {
899  return op(p->get_key());
900  });
901  }
902 
903  template <class Operation>
904  bool traverse(Operation && op = Operation())
905  {
906  return traverse<Operation>(op);
907  }
908 
909  template <class Operation>
910  bool traverse(Operation & op) const
911  {
912  return Aleph::traverse(tree.getRoot(), [&op] (Node * p)
913  {
914  return op(p->get_key());
915  });
916  }
917 
918  template <class Operation>
919  bool traverse(Operation && op = Operation()) const
920  {
921  return traverse<Operation>(op);
922  }
923 };
924 
925 
926 # define SETTREE_ITOR(Name, Key, Cmp) \
927  class Iterator : public DynSetTree<Key, Name, Cmp>::Iterator \
928  { \
929  public: \
930  Iterator() : DynSetTree<Key, Name, Cmp>::Iterator() \
931  { /* empty */ } \
932  \
933  Iterator(DynSetTree<Key, Name, Cmp> & tree) \
934  : DynSetTree<Key, Name, Cmp>::Iterator(tree) \
935  { /* empty */ } \
936  };
937 
938 
945  template <typename Key, class Compare = Aleph::less<Key>>
946  class DynSetBinTree : public DynSetTree<Key, BinTree, Compare>
947  {
948  public:
950  using Base::Base;
951  };
952 
953 
960  template <typename Key, class Compare = Aleph::less<Key>>
961  class DynSetAvlTree : public DynSetTree<Key, Avl_Tree, Compare>
962  {
963  public:
965  using Base::Base;
966  };
967 
968 
975  template <typename Key, class Compare = Aleph::less<Key>>
976  class DynSetSplayTree : public DynSetTree<Key, Splay_Tree, Compare>
977  {
978  public:
980  using Base::Base;
981  };
982 
983 
990  template <typename Key, class Compare = Aleph::less<Key>>
991 class DynSetRandTree : public DynSetTree<Key, Rand_Tree, Compare>
992 {
993 public:
995  using Base::Base;
996 
997  class Iterator : public DynSetTree<Key, Rand_Tree, Compare>::Iterator
998  {
999  public:
1001  { /* empty */ }
1002 
1003  Iterator(DynSetTree<Key, Rand_Tree, Compare> & tree)
1005  { /* empty */ }
1006  };
1007 };
1008 
1009 
1016  template <typename Key, class Compare = Aleph::less<Key>>
1017  class DynSetTreap : public DynSetTree<Key, Treap, Compare>
1018  {
1019  public:
1021  using Base::Base;
1022  };
1023 
1030  template <typename Key, class Compare = Aleph::less<Key>>
1031  class DynSetTreapRk : public DynSetTree<Key, Treap_Rk, Compare>
1032  {
1033  public:
1035  using Base::Base;
1036  SETTREE_ITOR(Treap_Rk, Key, Compare);
1037  };
1038 
1039 
1046  template <typename Key, class Compare = Aleph::less<Key>>
1047  class DynSetRbTree : public DynSetTree<Key, Rb_Tree, Compare>
1048  {
1049  public:
1051  using Base::Base;
1052  };
1053 
1054 
1055  template <typename T, class Op, class C>
1056 DynSetTree<T> set_unify(const C & c, Op op)
1057 {
1058  DynSetTree<T> ret;
1059  for (auto it = c.get_it(); it.has_curr(); it.next_ne())
1060  ret.insert(op(it.get_curr_ne()));
1061  return ret;
1062 }
1063 
1064 } // end namespace Aleph
1065 
1066 # endif /* TPL_DYNSETTREE_H */
1067 
1068 
1069 
1070 
1071 
1072 
1073 
1074 
1075 
1076 
void for_each_inorder(Key_Op &key_op) const
Definition: tpl_dynSetTree.H:685
Definition: htlist.H:450
Definition: htlist.H:1290
Definition: htlist.H:133
size_t internal_path_length() const
Definition: tpl_dynSetTree.H:509
Definition: tpl_binNodeUtils.H:322
void for_each_preorder(Key_Op &&key_op=Key_Op()) const
Definition: tpl_dynSetTree.H:655
typename Tree< GT::Arc *, Compare >::Node Node
Definition: tpl_dynSetTree.H:72
size_t computeHeightRec(Node *root) noexcept
Definition: tpl_binNodeUtils.H:480
const Key & get_last() const
Definition: tpl_dynSetTree.H:496
DynSetTree & join(DynSetTree &t, DynSetTree &dup)
Definition: tpl_dynSetTree.H:757
size_t internal_path_length(Node *p) noexcept
Definition: tpl_binNodeUtils.H:931
bool check_bst(Node *p, Compare cmp=Compare())
Definition: tpl_binNodeUtils.H:1262
Node * find_min(Node *root) noexcept
Definition: tpl_binNodeUtils.H:1346
std::pair< int, Key * > find_position(const Key &key) const
Definition: tpl_dynSetTree.H:438
auto & COUNT(Node *p) noexcept
Definition: tpl_binNodeXt.H:66
DynSetTree(const DynSetTree &srcTree)
Instancia un conjunto dinámico copia de srcTree.
Definition: tpl_dynSetTree.H:110
Definition: tpl_dynSetTree.H:946
Key remove_pos(const size_t i)
Definition: tpl_dynSetTree.H:372
virtual ~DynSetTree()
Destructor; todos los elementos son liberados.
Definition: tpl_dynSetTree.H:168
void split_pos(const size_t pos, DynSetTree &l, DynSetTree &r)
Definition: tpl_dynSetTree.H:831
Definition: tpl_dynSetTree.H:961
Key & select(const size_t &i)
Definition: tpl_dynSetTree.H:561
DynSetTree(Compare cmp=Compare())
Instancia un conjunto dinámico.
Definition: tpl_dynSetTree.H:103
void swap(DynSetTree &dset)
Definition: tpl_dynSetTree.H:96
Node::Key_Type & KEY(Node *p) noexcept
Definition: tpl_binNode.H:318
int preOrderRec(Node *root, void(*visitFct)(Node *, int, int))
Definition: tpl_binNodeUtils.H:124
Definition: tpl_binNodeUtils.H:256
const Key & get_item() const
Retorna un elemento cualquiera del conjunto.
Definition: tpl_dynSetTree.H:524
void for_each_preorder(Key_Op &key_op) const
Definition: tpl_dynSetTree.H:644
void for_each_in_preorder(void(*visitFct)(Node *, int, int))
Definition: tpl_dynSetTree.H:532
Definition: tpl_dynSetTree.H:976
Definition: ah-comb.H:35
bool split_key(const Key &key, DynSetTree &l, DynSetTree &r)
Definition: tpl_dynSetTree.H:805
void split_key_dup(const Key &key, DynSetTree &l, DynSetTree &r)
Definition: tpl_dynSetTree.H:851
Definition: tpl_dynSetTree.H:991
DynSetTree & join_dup(DynSetTree &t)
Definition: tpl_dynSetTree.H:781
const Key & get_first() const
Definition: tpl_dynSetTree.H:483
const Key & max() const
Definition: tpl_dynSetTree.H:487
void for_each_inorder(Key_Op &&key_op=Key_Op()) const
Definition: tpl_dynSetTree.H:696
void destroyRec(Node *&root) noexcept
Definition: tpl_binNodeUtils.H:500
const size_t & size() const
Retorna la cardinalidad del conjunto.
Definition: tpl_dynSetTree.H:502
bool exist(const Key &key) const
Retorna true si key pertenece al conjunto dinámico.
Definition: tpl_dynSetTree.H:385
Definition: tpl_treapRk.H:1010
Definition: tpl_dynSetTree.H:61
Definition: tpl_binNodeUtils.H:191
void for_each_postorder(Key_Op &&key_op=Key_Op())
Definition: tpl_dynSetTree.H:737
Definition: tpl_dynSetTree.H:1031
Key & find(const Key &key) const
Definition: tpl_dynSetTree.H:414
void for_each_postorder(Key_Op &key_op)
Definition: tpl_dynSetTree.H:726
Node * find_max(Node *root) noexcept
Definition: tpl_binNodeUtils.H:1363
Definition: tpl_dynSetTree.H:1047
Definition: ahDry.H:41
Node * copyRec(Node *root)
Definition: tpl_binNodeUtils.H:519
const Key & min() const
Definition: tpl_dynSetTree.H:474
Key * search_or_insert(const Key &key)
Definition: tpl_dynSetTree.H:254
Key del(const Key &key)
Definition: tpl_dynSetTree.H:349
Definition: tpl_dynSetTree.H:1017
bool traverse(Operation &op)
Definition: tpl_dynSetTree.H:895
void empty()
Elimina todos los elementos del conjunto.
Definition: tpl_dynSetTree.H:133
Definition: List.H:49
long position(const Key &key) const
Definition: tpl_dynSetTree.H:550
size_t height() const
Calcula y retorna la altura del árbol binario de búsqueda.
Definition: tpl_dynSetTree.H:527
DynSetTree & join(DynSetTree &t, DynSetTree &&dup=DynSetTree())
Definition: tpl_dynSetTree.H:764
bool is_empty() const
Retorna true si el conjunto está vacío.
Definition: tpl_dynSetTree.H:505
Key * insert(const Key &key)
Definition: tpl_dynSetTree.H:195
Definition: htlist.H:1323
Key * search(const Key &key) const
Definition: tpl_dynSetTree.H:462

Leandro Rabindranath León