4#include <rudiments/stdio.h>
5#include <rudiments/private/nodeinlines.h>
7template <
class valuetype>
17template <
class valuetype>
24template <
class valuetype>
31template <
class valuetype>
38template <
class valuetype>
50template <
class valuetype>
62template <
class valuetype>
74template <
class valuetype>
80 count=tree->getCount();
85 top=cloneNode(tree->getTop());
89 first->getLeftChild();
90 first=first->getLeftChild()) {}
94 last->getRightChild();
95 last=last->getRightChild()) {}
99template <
class valuetype>
110 bool managevalues=this->getManageValues();
111 bool managearrayvalues=this->getManageArrayValues();
113 node; node=node->getNext()) {
114 insert(node_duplicate_value(
115 &(node->getReference()),
116 managevalues,managearrayvalues));
121 first->getLeftChild();
122 first=first->getLeftChild()) {}
126 last->getRightChild();
127 last=last->getRightChild()) {}
131template <
class valuetype>
141 this->getManageValues(),
142 this->getManageArrayValues()));
165template <
class valuetype>
171template <
class valuetype>
177template <
class valuetype>
189 insert(top,
node,&top);
213template <
class valuetype>
238 }
else if (this->getComparator()->compare(
254 top->adjustParentHeights(
node);
260template <
class valuetype>
288template <
class valuetype>
295template <
class valuetype>
299 while (remove(value)) {
305template <
class valuetype>
310 this->getManageValues(),
311 this->getManageArrayValues());
316template <
class valuetype>
322template <
class valuetype>
328template <
class valuetype>
334template <
class valuetype>
340template <
class valuetype>
347template <
class valuetype>
354template <
class valuetype>
360template <
class valuetype>
385template <
class valuetype>
389 bool managevalues=this->getManageValues();
390 bool managearrayvalues=this->getManageArrayValues();
410 p->setLeftChild(
NULL);
412 p->setRightChild(
NULL);
418 managevalues,managearrayvalues);
436template <
class valuetype>
465 " lh=\"%d\" rh=\"%d\" bf=\"%d\"",
466 leftheight,rightheight,
467 leftheight-rightheight)):true);
473 writeNodeXml(out,left,
"l",
478 writeNodeXml(out,right,
"r",
492template <
class valuetype>
509 ((indent)?this->incOrErr(&
retval,out->
write(
'\n'),1):true);
517 ((indent)?this->incOrErr(&
retval,out->
write(
'\n'),1):true);
553template <
class valuetype>
565template <
class valuetype>
570template <
class valuetype>
576template <
class valuetype>
582template <
class valuetype>
588template <
class valuetype>
594template <
class valuetype>
600template <
class valuetype>
606template <
class valuetype>
612template <
class valuetype>
618template <
class valuetype>
669template <
class valuetype>
720template <
class valuetype>
726template <
class valuetype>
732template <
class valuetype>
738template <
class valuetype>
744template <
class valuetype>
750template <
class valuetype>
815 parent->setLeftChild(
this);
817 parent->setRightChild(
this);
831 left->setParent(
this);
835 right->setParent(
this);
865 parent->setLeftChild(
child);
868 parent->setRightChild(
child);
874 child->setParent(parent);
884 adjustParentHeights(
p);
907template <
class valuetype>
943template <
class valuetype>
990template <
class valuetype>
1017 p->setRightChild(
b);
1029 a->setRightChild(
star);
1038 adjustParentHeights(
a);
1046template <
class valuetype>
1074 a->setRightChild(
b);
1076 b->setRightChild(
c);
1080 c->setLeftChild(
star);
1089 adjustParentHeights(
c);
1100template <
class valuetype>
1127 p->setRightChild(
b);
1135 b->setRightChild(
c);
1139 c->setLeftChild(
star);
1148 adjustParentHeights(
c);
1156template <
class valuetype>
1190 a->setRightChild(
star);
1199 adjustParentHeights(
a);
treenode< valuetype > * getTop()
Definition avltreeinlines.h:324
treenode< valuetype > * getLast()
Definition avltreeinlines.h:336
treenode< valuetype > * find(valuetype value)
Definition avltreeinlines.h:356
avltree< valuetype > & operator=(avltree< valuetype > &a)
Definition avltreeinlines.h:40
treenode< valuetype > * getFirst()
Definition avltreeinlines.h:330
bool remove(valuetype value)
Definition avltreeinlines.h:290
void insert(valuetype value)
Definition avltreeinlines.h:173
treenode< valuetype > * getPrevious(treenode< valuetype > *node)
Definition avltreeinlines.h:342
treenode< valuetype > * detach(treenode< valuetype > *node)
Definition avltreeinlines.h:262
bool removeAll(valuetype value)
Definition avltreeinlines.h:297
~avltree()
Definition avltreeinlines.h:167
bool clear()
Definition avltreeinlines.h:387
avltree()
Definition avltreeinlines.h:9
uint64_t getCount()
Definition avltreeinlines.h:318
treenode< valuetype > * getNext(treenode< valuetype > *node)
Definition avltreeinlines.h:349
~avltreenode()
Definition avltreeinlines.h:567
treenode< valuetype > * getRightChild()
Definition avltreeinlines.h:602
treenode< valuetype > * getLeftChild()
Definition avltreeinlines.h:596
avltreenode(valuetype value)
Definition avltreeinlines.h:555
treenode< valuetype > * getParent()
Definition avltreeinlines.h:590
treenode< valuetype > * getNext()
Definition avltreeinlines.h:671
treenode< valuetype > * getPrevious()
Definition avltreeinlines.h:620
valuetype & getReference()
Definition avltreeinlines.h:584
uint8_t getLeftHeight()
Definition avltreeinlines.h:608
uint8_t getRightHeight()
Definition avltreeinlines.h:614
valuetype getValue()
Definition avltreeinlines.h:578
void setValue(valuetype value)
Definition avltreeinlines.h:572
collection & operator=(collection &c)
Definition collectioninlines.h:30
Definition nodecollection.h:31
virtual nodecollectionnode< valuetype > * getFirst()=0
Definition nodecollection.h:12
virtual ssize_t printf(const char *format,...)
Definition outputinlines.h:25
virtual ssize_t write(const byte_t *string, size_t size)=0
Definition treecollection.h:57
Definition treecollection.h:12