Aleph-w  1.9
General library for algorithms and data structures
tpl_binNodeXt.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_BINNODEXT_H
29 # define TPL_BINNODEXT_H
30 
31 # include <tpl_binNode.H>
32 # include <tpl_binNodeUtils.H>
33 
34 using namespace Aleph;
35 
36 namespace Aleph {
37 
38 class BinNodeXt_Data
39 {
40  size_t count; // cardinalidad del árbol
41 
42 public:
43 
44  BinNodeXt_Data() noexcept : count(1) {}
45  BinNodeXt_Data(SentinelCtor) noexcept : count(0) {}
46 
47  size_t & getCount() noexcept { return count; }
48  size_t size() const noexcept { return count; }
49 
50  void reset() noexcept { count = 1; }
51 };
52 
59 DECLARE_BINNODE_SENTINEL(BinNodeXt, 255, BinNodeXt_Data);
60 
66 template <class Node> inline auto & COUNT(Node * p) noexcept
67 {
68  return p->getCount();
69 }
70 
71 
72  template <class Node> static inline
73 Node * __select_rec(Node * r, const size_t i) noexcept
74 {
75  assert(r != Node::NullPtr);
76  assert(COUNT(Node::NullPtr) == 0);
77 
78  if (i == COUNT(LLINK(r)))
79  return r;
80 
81  if (i < COUNT(LLINK(r)))
82  return __select_rec(LLINK(r), i);
83 
84  return __select_rec(RLINK(r), i - COUNT(LLINK(r)) - 1);
85 }
86 
98  template <class Node> inline
99 Node * select_rec(Node * r, const size_t i)
100 {
101  if (i >= COUNT(r))
102  throw std::out_of_range("infix position out of range");
103 
104  return __select_rec(r, i);
105 }
106 
117  template <class Node> inline
118 Node * select_ne(Node * r, const size_t pos) noexcept
119 {
120  assert(COUNT(Node::NullPtr) == 0);
121  for (size_t i = pos; i != COUNT(LLINK(r)); /* nada */)
122  {
123  assert(i < COUNT(r) and
124  COUNT(LLINK(r)) + COUNT(RLINK(r)) + 1 == COUNT(r));
125 
126  if (i < COUNT(LLINK(r)))
127  r = LLINK(r);
128  else
129  {
130  i -= COUNT(LLINK(r)) + 1;
131  r = RLINK(r);
132  }
133  }
134 
135  return r;
136 }
137 
149  template <class Node> inline
150 Node * select(Node * r, const size_t pos)
151 {
152  assert(COUNT(Node::NullPtr) == 0);
153  if (pos >= COUNT(r))
154  throw std::out_of_range("infix position out of range");
155 
156  return select_ne(r, pos);
157 }
158 
172  template <class Node> inline
173 Node * select(Node * root, const size_t pos, Node *& parent)
174 {
175  assert(COUNT(Node::NullPtr) == 0);
176 
177  if (pos >= COUNT(root))
178  throw std::out_of_range("infix position out of range");
179 
180  parent = Node::NullPtr;
181  for (size_t i = pos; i != COUNT(LLINK(root)); /* nada */)
182  {
183  assert(i < COUNT(root) and
184  COUNT(LLINK(root)) + COUNT(RLINK(root)) + 1 == COUNT(root));
185 
186  parent = root;
187  if (i < COUNT(LLINK(root)))
188  root = LLINK(root);
189  else
190  {
191  i -= COUNT(LLINK(root)) + 1;
192  root = RLINK(root);
193  }
194  }
195 
196  return root;
197 }
198 
209  template <class Node, class Compare> inline
210 long inorder_position(Node * r,
211  const typename Node::key_type & key,
212  Node *& p, Compare & cmp) noexcept
213 {
214  assert(COUNT(Node::NullPtr) == 0);
215 
216  if (r == Node::NullPtr)
217  return -1;
218 
219  if (cmp(key, KEY(r)))
220  return inorder_position(LLINK(r), key, p, cmp);
221  else if (cmp(KEY(r), key))
222  {
223  long ret = inorder_position(RLINK(r), key, p, cmp);
224  if (ret != -1)
225  return ret + COUNT(LLINK(r)) + 1;
226  return ret;
227  }
228  else
229  {
230  p = r;
231  return COUNT(LLINK(r));
232  }
233 }
234 
236 template <class Node, class Compare = Aleph::less<typename Node::key_type>>
237  inline long inorder_position(Node * r,
238  const typename Node::key_type & key,
239  Node *& p, Compare && cmp = Compare())
240  noexcept
241 {
242  return inorder_position(r, key, p, cmp);
243 }
244 
246  template <class Node, class Compare> inline
247 long inorder_position(Node * r, const typename Node::key_type & key,
248  Compare & cmp) noexcept
249 {
250  Node * p = nullptr;
251  return inorder_position(r, key, p, cmp);
252 }
253 
255  template <class Node, class Compare = Aleph::less<typename Node::key_type>>
256 inline long inorder_position(Node * r, const typename Node::key_type & key,
257  Compare && cmp = Compare()) noexcept
258 {
259  return inorder_position(r, key, cmp);
260 }
261 
288  template <class Node,
289  class Compare = Aleph::less<typename Node::key_type>> inline
290 long find_position(Node * r, const typename Node::key_type & key,
291  Node *& p, Compare & cmp) noexcept
292 {
293  assert(COUNT(Node::NullPtr) == 0);
294 
295  Node * parent = nullptr;
296  long pos = COUNT(LLINK(r));
297 
298  while (r != Node::NullPtr)
299  if (cmp(key, KEY(r)))
300  {
301  parent = r;
302  r = LLINK(r);
303  pos -= (COUNT(RLINK(r)) + 1);
304  }
305  else if (cmp(KEY(r), key))
306  {
307  parent = r;
308  r = RLINK(r);
309  pos += COUNT(LLINK(r)) + 1;
310  }
311  else
312  {
313  p = r;
314  return pos;
315  }
316 
317  p = parent;
318 
319  return pos;
320 }
321 
322 template <class Node,
323  class Compare = Aleph::less<typename Node::key_type>> inline
324 long find_position(Node * r, const typename Node::key_type & key,
325  Node *& p, Compare && cmp = Compare()) noexcept
326 {
327  return find_position(r, key, p, cmp);
328 }
329 
343  template <class Node, class Compare> inline
344 Node * insert_by_key_xt(Node *& r, Node * p, Compare & cmp) noexcept
345 {
346  assert(COUNT(Node::NullPtr) == 0);
347 
348  if (r == Node::NullPtr)
349  return r = p;
350 
351  Node * q = Node::NullPtr;
352  if (cmp(KEY(p), KEY(r)))
353  {
354  q = insert_by_key_xt(LLINK(r), p, cmp);
355  if (q != Node::NullPtr)
356  ++COUNT(r);
357  }
358  else if (cmp(KEY(r), KEY(p)))
359  {
360  q = insert_by_key_xt(RLINK(r), p, cmp);
361  if (q != Node::NullPtr)
362  ++COUNT(r);
363  }
364  // else return Node::NullPtr; is not needed
365 
366  return q;
367 }
368 
370  template <class Node,
371  class Compare = Aleph::less<typename Node::key_type>> inline
372 Node * insert_by_key_xt(Node *& r, Node * p, Compare && cmp = Compare())
373  noexcept
374 {
375  return insert_by_key_xt(r, p, cmp);
376 }
377 
388  template <class Node, class Compare> inline
389 Node * insert_dup_by_key_xt(Node *& r, Node * p, Compare & cmp) noexcept
390 {
391  assert(COUNT(Node::NullPtr) == 0);
392 
393  if (r == Node::NullPtr)
394  return r = p;
395 
396  Node * q;
397  if (cmp(KEY(p), KEY(r)))
398  q = insert_dup_by_key_xt(LLINK(r), p, cmp);
399  else
400  q = insert_dup_by_key_xt(RLINK(r), p, cmp);
401 
402  ++COUNT(r);
403 
404  return q;
405 }
406 
408  template <class Node,
409  class Compare = Aleph::less<typename Node::key_type>> inline
410 Node * insert_dup_by_key_xt(Node *& r, Node * p, Compare && cmp = Compare())
411  noexcept
412 {
413  return insert_by_key_xt(r, p, cmp);
414 }
415 
428  template <class Node, class Compare> inline
429 Node * search_or_insert_by_key_xt(Node *& r, Node * p, Compare & cmp) noexcept
430 {
431  assert(COUNT(Node::NullPtr) == 0);
432 
433  if (r == Node::NullPtr)
434  return r = p;
435 
436  Node * q;
437  if (cmp(KEY(p), KEY(r)))
438  {
439  q = insert_by_key_xt(LLINK(r), p, cmp);
440  if (q != Node::NullPtr)
441  ++COUNT(r);
442  }
443  else if (cmp(KEY(r), KEY(p)))
444  {
445  q = insert_by_key_xt(RLINK(r), p, cmp);
446  if (q != Node::NullPtr)
447  ++COUNT(r);
448  }
449  else
450  return r;
451 
452  return q;
453 }
454 
456 template <class Node,
457  class Compare = Aleph::less<typename Node::key_type>> inline
458 Node * search_or_insert_by_key_xt(Node *& r, Node * p,
459  Compare && cmp = Compare()) noexcept
460 {
461  return search_or_insert_by_key_xt(r, p, cmp);
462 }
463 
464 
465  template <class Node, class Compare> static inline
466 bool __split_key_rec_xt(Node * root, const typename Node::key_type & key,
467  Node *& l, Node *& r, Compare & cmp) noexcept
468 {
469  if (root == Node::NullPtr)
470  {
471  l = r = Node::NullPtr;
472  return true;
473  }
474 
475  if (cmp(key, KEY(root)))
476  {
477  if (not __split_key_rec_xt(LLINK(root), key, l, LLINK(root), cmp))
478  return false;
479 
480  r = root;
481  COUNT(r) -= COUNT(l);
482  }
483  else if (cmp(KEY(root), key))
484  {
485  if (not __split_key_rec_xt(RLINK(root), key, RLINK(root), r, cmp))
486  return false;
487 
488  l = root;
489  COUNT(l) -= COUNT(r);
490  }
491  else
492  return false;
493 
494  return true;
495 }
496 
511 template <class Node, class Compare> inline
512 bool split_key_rec_xt(Node *& root, const typename Node::key_type & key,
513  Node *& l, Node *& r, Compare & cmp) noexcept
514 {
515  bool ret = __split_key_rec_xt(root, key, l, r, cmp);
516  if (ret)
517  root = Node::NullPtr;
518  return ret;
519 }
520 
522 template <class Node,
523  class Compare = Aleph::less<typename Node::key_type>> inline
524 bool split_key_rec_xt(Node *& root, const typename Node::key_type & key,
525  Node *& l, Node *& r, Compare && cmp = Compare())
526  noexcept
527 {
528  return split_key_rec_xt(root, key, l, r, cmp);
529 }
530 
531 
532  template <class Node, class Compare> static inline
533 void __split_key_dup_rec_xt(Node * root, const typename Node::key_type & key,
534  Node *& l, Node *& r, Compare & cmp) noexcept
535 {
536  if (root == Node::NullPtr)
537  {
538  l = r = Node::NullPtr;
539  return;
540  }
541 
542  if (cmp(key, KEY(root)))
543  {
544  __split_key_dup_rec_xt(LLINK(root), key, l, LLINK(root), cmp);
545  r = root;
546  COUNT(r) -= COUNT(l);
547  }
548  else
549  {
550  __split_key_dup_rec_xt(RLINK(root), key, RLINK(root), r, cmp);
551  l = root;
552  COUNT(l) -= COUNT(r);
553  }
554 }
555 
556 
571  template <class Node, class Compare> inline
572 void split_key_dup_rec_xt(Node *& root, const typename Node::key_type & key,
573  Node *& l, Node *& r, Compare & cmp) noexcept
574 {
575  __split_key_dup_rec_xt<Node, Compare>(root, key, l, r, cmp);
576  root = Node::NullPtr;
577 }
578 
580  template <class Node,
581  class Compare = Aleph::less<typename Node::key_type>> inline
582 void split_key_dup_rec_xt(Node *& root, const typename Node::key_type & key,
583  Node *& l, Node *& r, Compare && cmp = Compare())
584  noexcept
585 {
586  return split_key_dup_rec_xt(root, key, l, r, cmp);
587 }
588 
604  template <class Node, class Compare> inline
605 Node * insert_root_xt(Node *& root, Node * p, Compare & cmp) noexcept
606 {
607  if (root == Node::NullPtr)
608  {
609  root = p;
610  return p;
611  }
612 
613  if (not split_key_rec_xt(root, KEY(p), LLINK(p), RLINK(p), cmp))
614  return Node::NullPtr;
615 
616  COUNT(p) = COUNT(LLINK(p)) + COUNT(RLINK(p)) + 1;
617  root = p;
618 
619  return p;
620 }
621 
623  template <class Node,
624  class Compare = Aleph::less<typename Node::key_type>> inline
625 Node * insert_root_xt(Node *& root, Node * p, Compare && cmp = Compare())
626  noexcept
627 {
628  return insert_root_xt(root, p, cmp);
629 }
630 
645  template <class Node, class Compare> inline
646 Node * insert_dup_root_xt(Node *& root, Node * p, Compare & cmp) noexcept
647 {
648  if (root == Node::NullPtr)
649  return p;
650 
651  split_key_dup_rec_xt(root, KEY(p), LLINK(p), RLINK(p), cmp);
652  COUNT(p) = COUNT(LLINK(p)) + COUNT(RLINK(p)) + 1;
653 
654  return root = p;
655 }
656 
658 template <class Node,
659  class Compare = Aleph::less<typename Node::key_type>> inline
660 Node * insert_dup_root_xt(Node *& root, Node * p, Compare && cmp = Compare())
661  noexcept
662 {
663  return insert_dup_root_xt(root, p, cmp);
664 }
665 
666 
667  template <class Node> static inline
668 void __split_pos_rec(Node * r, size_t i, Node *& ts, Node *& tg) noexcept
669 {
670  if (i == COUNT(LLINK(r)))
671  {
672  ts = LLINK(r);
673  tg = r;
674  LLINK(tg) = Node::NullPtr;
675  COUNT(tg) -= COUNT(ts);
676  return;
677  }
678 
679  if (i < COUNT(LLINK(r)))
680  {
681  __split_pos_rec(LLINK(r), i, ts, LLINK(r));
682  tg = r;
683  COUNT(r) -= COUNT(ts);
684  }
685  else
686  {
687  __split_pos_rec(RLINK(r), i - (COUNT(LLINK(r)) + 1), RLINK(r), tg);
688  ts = r;
689  COUNT(r) -= COUNT(tg);
690  }
691 }
692 
693 
709 template <class Node> inline
710 void split_pos_rec(Node *& r, const size_t i, Node *& ts, Node *& tg)
711 {
712  if (i > COUNT(r))
713  throw std::out_of_range("infix position out of range");
714 
715  if (i == COUNT(r)) // ¿Es la última posición?
716  {
717  ts = r;
718  r = tg = Node::NullPtr;
719  return;
720  }
721 
722  __split_pos_rec<Node>(r, i, ts, tg);
723 
724  r = Node::NullPtr;
725 }
726 
741  template <class Node> inline
742 void insert_by_pos_xt(Node *& r, Node * p, size_t pos)
743 {
744  assert(COUNT(Node::NullPtr) == 0);
745 
746  split_pos_rec(r, pos, LLINK(p), RLINK(p));
747  COUNT(p) = COUNT(LLINK(p)) + 1 + COUNT(RLINK(p));
748  r = p;
749 }
750 
763  template <class Node> inline
764 Node * join_exclusive_xt(Node *& ts, Node *& tg) noexcept
765 {
766  if (ts == Node::NullPtr)
767  return tg;
768 
769  if (tg == Node::NullPtr)
770  return ts;
771 
772  LLINK(tg) = join_exclusive_xt(RLINK(ts), LLINK(tg));
773  RLINK(ts) = tg;
774 
775  // actualizar contadores
776  COUNT(tg) = COUNT(LLINK(tg)) + 1 + COUNT(RLINK(tg));
777  COUNT(ts) = COUNT(LLINK(ts)) + 1 + COUNT(RLINK(ts));
778 
779  Node * ret_val = ts;
780  ts = tg = Node::NullPtr; // deben quedar vacíos después del join
781 
782  return ret_val;
783 }
784 
785 
801  template <class Node,
802  class Compare = Aleph::less<typename Node::key_type>> inline
803 Node * remove_by_key_xt(Node *& root, const typename Node::key_type & key,
804  Compare & cmp) noexcept
805 {
806  assert(root != Node::NullPtr);
807 
808  if (root == Node::NullPtr)
809  return Node::NullPtr;
810 
811  Node * ret_val = Node::NullPtr;
812  if (cmp(key, KEY(root)))
813  {
814  ret_val = remove_by_key_xt(LLINK(root), key, cmp);
815  if (ret_val != Node::NullPtr)
816  --COUNT(root);
817 
818  return ret_val;
819  }
820  else if (cmp(KEY(root), key))
821  {
822  ret_val = remove_by_key_xt(RLINK(root), key, cmp);
823  if (ret_val != Node::NullPtr)
824  --COUNT(root);
825 
826  return ret_val;
827  }
828 
829  ret_val = root;
830  root = join_exclusive_xt(LLINK(root), RLINK(root));
831 
832  ret_val->reset();
833 
834  return ret_val;
835 }
836 
838 template <class Node, class Compare = Aleph::less<typename Node::key_type>>
839 inline Node * remove_by_key_xt(Node *& root,
840  const typename Node::key_type & key,
841  Compare && cmp = Compare()) noexcept
842 {
843  return remove_by_key_xt(root, key, cmp);
844 }
845 
846 
847  template <class Node> static inline
848 Node * __remove_by_pos_xt(Node *& root, size_t pos) noexcept
849 {
850  if (COUNT(LLINK(root)) == pos) // found position?
851  {
852  Node * ret_val = root;
853  root = join_exclusive_xt(LLINK(root), RLINK(root));
854 
855  ret_val->reset();
856 
857  return ret_val;
858  }
859 
860  Node * ret_val;
861  if (pos < COUNT(LLINK(root)))
862  ret_val = __remove_by_pos_xt(LLINK(root), pos);
863  else
864  ret_val = __remove_by_pos_xt(RLINK(root), pos - (COUNT(LLINK(root)) + 1));
865 
866  if (ret_val != Node::NullPtr) // removal was done?
867  --COUNT(root);
868 
869  return ret_val;
870 }
871 
882  template <class Node> inline
883 Node * remove_by_pos_xt(Node *& root, size_t pos)
884 {
885  if (pos >= COUNT(root))
886  throw std::out_of_range("infix position out of range");
887 
888  return __remove_by_pos_xt(root, pos);
889 }
890 
895  template <class Node> inline
896 bool check_rank_tree(Node * root) noexcept
897 {
898  if (root == Node::NullPtr)
899  return true;
900 
901  if (COUNT(LLINK(root)) + COUNT(RLINK(root)) + 1 != COUNT(root))
902  return false;
903 
904  return check_rank_tree(LLINK(root)) and check_rank_tree(RLINK(root));
905 }
906 
913  template <class Node> inline
914 Node * rotate_to_right_xt(Node* p) noexcept
915 {
916  assert(p != Node::NullPtr);
917  assert(COUNT(LLINK(p)) + 1 + COUNT(RLINK(p)) == COUNT(p));
918 
919  Node * q = LLINK(p);
920  LLINK(p) = RLINK(q);
921  RLINK(q) = p;
922  COUNT(p) -= 1 + COUNT(LLINK(q));
923  COUNT(q) += 1 + COUNT(RLINK(p));
924  assert(COUNT(LLINK(q)) + 1 + COUNT(RLINK(q)) == COUNT(q));
925  return q;
926 }
927 
934  template <class Node> inline
935 Node * rotate_to_left_xt(Node* p) noexcept
936 {
937  assert(p != Node::NullPtr);
938  assert(COUNT(LLINK(p)) + 1 + COUNT(RLINK(p)) == COUNT(p));
939 
940  Node * q = RLINK(p);
941  RLINK(p) = LLINK(q);
942  LLINK(q) = p;
943  COUNT(p) -= 1 + COUNT(RLINK(q));
944  COUNT(q) += 1 + COUNT(LLINK(p));
945  assert(COUNT(LLINK(q)) + 1 + COUNT(RLINK(q)) == COUNT(q));
946  return q;
947 }
948 
949 
960  template <class Node, class Key, class Compare> inline
961 Node * search_or_insert_root_rec_xt(Node * root, Node * p, Compare & cmp)
962  noexcept
963 {
964  if (root == Node::NullPtr)
965  return p; // insertion in empty tree
966 
967  if (cmp(KEY(p), KEY(root)))
968  { // insert in left subtree
969  Node * left_branch = search_or_insert_root_rec_xt(LLINK(root), p, cmp);
970  if (left_branch == p) // p was inserted?
971  {
972  ++COUNT(root);
973  LLINK(root) = left_branch;
974  root = rotate_to_right_xt(root);
975  return p;
976  }
977 
978  return left_branch;
979  }
980  else if (cmp(KEY(root), KEY(p)))
981  { // insert in right subtree
982  Node * right_branch = search_or_insert_root_rec_xt(RLINK(root), p, cmp);
983  if (right_branch == p) // p was inserted?
984  {
985  ++COUNT(root);
986  RLINK(root) = right_branch;
987  root = rotate_to_left_xt(root);
988  return p;
989  }
990 
991  return right_branch;
992  }
993 
994  return root;
995 }
996 
998 template <class Node, class Key,
999  class Compare = Aleph::less<typename Node::key_type>> inline
1000 Node * search_or_insert_root_rec_xt(Node * root, Node * p,
1001  Compare && cmp = Compare()) noexcept
1002 {
1003  return search_or_insert_root_rec_xt(root, p, cmp);
1004 }
1005 
1006 
1007 } // end namespace Aleph
1008 
1009 # endif // TPL_BINNODEXT_H
1010 
Node * rotate_to_left_xt(Node *p) noexcept
Definition: tpl_binNodeXt.H:935
Node * remove_by_key_xt(Node *&root, const typename Node::key_type &key, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:803
auto & COUNT(Node *p) noexcept
Definition: tpl_binNodeXt.H:66
long find_position(Node *r, const typename Node::key_type &key, Node *&p, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:290
void split_key_dup_rec_xt(Node *&root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:572
Node * rotate_to_right_xt(Node *p) noexcept
Definition: tpl_binNodeXt.H:914
bool check_rank_tree(Node *root) noexcept
Definition: tpl_binNodeXt.H:896
Node::Key_Type & KEY(Node *p) noexcept
Definition: tpl_binNode.H:318
void split_pos_rec(Node *&r, const size_t i, Node *&ts, Node *&tg)
Definition: tpl_binNodeXt.H:710
Node * remove_by_pos_xt(Node *&root, size_t pos)
Definition: tpl_binNodeXt.H:883
Node * insert_by_key_xt(Node *&r, Node *p, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:344
Definition: ah-comb.H:35
Node * insert_root_xt(Node *&root, Node *p, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:605
long inorder_position(Node *r, const typename Node::key_type &key, Node *&p, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:210
Node for extended binary search tree.
Node * select_ne(Node *r, const size_t pos) noexcept
Definition: tpl_binNodeXt.H:118
Node * insert_dup_by_key_xt(Node *&r, Node *p, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:389
Node * insert_dup_root_xt(Node *&root, Node *p, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:646
Node *& LLINK(Node *p) noexcept
Definition: tpl_binNode.H:298
Node * join_exclusive_xt(Node *&ts, Node *&tg) noexcept
Definition: tpl_binNodeXt.H:764
Node * select(Node *root, const size_t pos, Node *&parent)
Definition: tpl_binNodeXt.H:173
#define DECLARE_BINNODE_SENTINEL(Name, height, Control_Data)
Definition: tpl_binNode.H:272
void insert_by_pos_xt(Node *&r, Node *p, size_t pos)
Definition: tpl_binNodeXt.H:742
bool split_key_rec_xt(Node *&root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &cmp) noexcept
Definition: tpl_binNodeXt.H:512
Node * select_rec(Node *r, const size_t i)
Definition: tpl_binNodeXt.H:99
Node *& RLINK(Node *p) noexcept
Definition: tpl_binNode.H:307

Leandro Rabindranath León