35 template<
class HT_TYPE>
54 int useIndexL=0, useIndexR=0;
58 if (((*(*
this)[index]).*compare)(*(*
this)[indexL])<0)
63 if (((*(*
this)[index]).*compare)(*(*
this)[indexR])<0)
66 if (useIndexR && useIndexL){
68 if (((*(*
this)[indexL]).*compare)(*(*
this)[indexR])<0)
107 if ((*(*
this)[parent].*compare)(*(*
this)[index])<0){
124 unsigned int index=0;
153 for (
int i=0;i<HeapTreeType<HT_TYPE*>::unsortedCount; i++){
170 #endif //HEAP_TREE_H_
int(HT_TYPE::* HTCompareMethod)(const HT_TYPE &) const
void findChildren(unsigned int parent, HeapTreeCell &childL, HeapTreeCell &childR)
void swap(unsigned int one, unsigned int two)
void swapIfBigger(unsigned int index, HTCompareMethod compare)
void add(HT_TYPE *value, HTCompareMethod compare)
void sort(LinkList< HT_TYPE *> &ll, HTCompareMethod compare)
unsigned int findIndex(HeapTreeCell &cell)
void deleteElements(void)
TYPE remove(void)
remove the current lug from the LinkList The current lug is removed form the list and passed back to ...
HeapTree(int baseIn=2)
Constructor - currrently only supports baseIn=2 : to be expanded in the future.
void add(TYPE newElement)
Adds as the current element ... Added to the next of the current lug.
void resize(size_t s, HT_TYPE * c=HT_TYPE *())
virtual void deleteElements(void)
unsigned int findParent(unsigned int index)
void sort(HTCompareMethod compare)