Go to the source code of this file.
|
template<class T > |
void | HeapSort (T *c, long n) |
|
template<class T > |
void | HeapSort (int **porder, T *c, int n) |
|
◆ HeapSort() [1/2]
template<class T >
void HeapSort |
( |
T * |
c, |
|
|
long |
n |
|
) |
| |
|
inline |
Definition at line 5 of file HeapSort.h.
36 if (j>r){c[i]=crit;
break;}
37 if ((j<r) && (c[j] < c[j+1])) j++;
38 if (crit < c[j]) c[i]=c[j];
39 else{c[i]=crit;
break;}
◆ HeapSort() [2/2]
template<class T >
void HeapSort |
( |
int ** |
porder, |
|
|
T * |
c, |
|
|
int |
n |
|
) |
| |
|
inline |
Definition at line 46 of file HeapSort.h.
62 for(i=0;i<n;i++) order[i]=i;
68 crit =c[r]; pos=order[r];
69 c[r--]=c[1]; order[r+1]=order[1];
71 c[1]=crit; order[1]=pos;
77 else {crit=c[--l]; pos=order[l];}
82 if (j>r) {c[i]=crit;order[i]=pos;
break;}
83 if ((j<r) && (c[j] < c[j+1]))j++;
89 c[i]=crit;order[i]=pos;