31 #include "common/list.h" 52 for (
int i = 0; i < 2; i++)
56 mParentDir = aParentDir;
60 if (mChild[i] == NULL) {
79 eBinTreeNode mParentDir;
104 DeleteNode(mFirstNode);
116 if (mFirstNode == NULL) {
117 mFirstNode = hplNew(
BinTreeNode<T>, (aData, NULL, eBinTreeNode_Left));
128 c = eBinTreeNode_Left;
132 if (Node->GetChild(c) == NULL) {
133 Node = Node->AddChild(c, aData);
136 Node = Node->GetChild(c);
155 if (aNode->GetChild(aChild) != NULL) {
156 aChild = aChild == eBinTreeNode_Left ? eBinTreeNode_Right : eBinTreeNode_Left;
157 if (aNode->GetChild(aChild) != NULL)
161 return aNode->AddChild(aChild, aData);
174 PopulateLeafList(mFirstNode);
184 PopulateNodeList(mFirstNode);
199 DeleteNode(aNode->GetChild(eBinTreeNode_Left));
200 DeleteNode(aNode->GetChild(eBinTreeNode_Right));
210 PopulateNodeList(aNode->GetChild(eBinTreeNode_Left));
212 PopulateNodeList(aNode->GetChild(eBinTreeNode_Right));
219 if (aNode->GetChild(eBinTreeNode_Left) == NULL &&
220 aNode->GetChild(eBinTreeNode_Right) == NULL) {
224 PopulateLeafList(aNode->GetChild(eBinTreeNode_Left));
225 PopulateLeafList(aNode->GetChild(eBinTreeNode_Right));
231 #endif // HPL_BINTREE_H
int Size()
Definition: BinTree.h:168
BinTreeNode< T > * InsertAt(T aData, BinTreeNode< T > *aNode, eBinTreeNode aChild=eBinTreeNode_Left)
Definition: BinTree.h:151
const Common::List< BinTreeNode< T > * > & GetNodeList()
Definition: BinTree.h:182
void clear()
Definition: list.h:206
BinTreeNode< T > * Insert(T aData)
Definition: BinTree.h:115
void push_back(const t_T &element)
Definition: list.h:140
Definition: lobject.h:332
int Clear()
Definition: BinTree.h:102