File tree Expand file tree Collapse file tree
Mathematical_Functions/Shared_C_Code Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 tempP=a[idxP];\
3535 tempIdxPerc=idxListHS[idxP];\
3636 if(direction==0) {\
37- while(2*idxP<numInHeap) {\
38- size_t child=2*idxP;\
37+ while(2*idxP+1 <numInHeap) {\
38+ size_t child=2*idxP+1 ;\
3939\
4040 if(child!=(numInHeap-1)&&a[child+1]>a[child]) {\
4141 child++;\
5151 idxP=child;\
5252 }\
5353 } else {\
54- while(2*idxP<numInHeap) {\
55- size_t child=2*idxP;\
54+ while(2*idxP+1 <numInHeap) {\
55+ size_t child=2*idxP+1 ;\
5656\
5757 if(child!=(numInHeap-1)&&a[child+1]<a[child]) {\
5858 child++;\
107107\
108108 tempP=a[idxP];\
109109 if(direction==0) {\
110- while(2*idxP<numInHeap) {\
111- size_t child=2*idxP;\
110+ while(2*idxP+1 <numInHeap) {\
111+ size_t child=2*idxP+1 ;\
112112\
113113 if(child!=(numInHeap-1)&&a[child+1]>a[child]) {\
114114 child++;\
123123 idxP=child;\
124124 }\
125125 } else {\
126- while(2*idxP<numInHeap) {\
127- size_t child=2*idxP;\
126+ while(2*idxP+1 <numInHeap) {\
127+ size_t child=2*idxP+1 ;\
128128\
129129 if(child!=(numInHeap-1)&&a[child+1]<a[child]) {\
130130 child++;\
You can’t perform that action at this time.
0 commit comments