3113n
06-04-2006, 12:26 PM
Hi,
Sorry - another heapsort problem... I would really appreciate any suggestions. I am trying to sort an array of 80,000 integers and heapsort almost works except in a 3 or 4 places. I have shortened the array now to:
ra[0]=13697;
ra[1]=114269;
ra[2]=114269;
ra[3]=98514;
ra[4]=114167;
ra[5]=105169;
ra[6]=112051;
ra[7]=102445;
ra[8]=102965;
ra[9]=105585;
ra[10]=106043;
ra[11]=16995;
ra[12]=113773;
ra[13]=113863;
ra[14]=100632;
ra[15]=52743;
ra[16]=52723;
and hpsort from NRinC sorts it to
ra[0]=13697
ra[1]=1.02295e-43
ra[2]=16995
ra[3]=52723
ra[4]=52743
ra[5]=98514
ra[6]=100632
ra[7]=102445
ra[8]=102965
ra[9]=105169
ra[10]=105585
ra[11]=106043
ra[12]=112051
ra[13]=113773
ra[14]=113863
ra[15]=114167
ra[16]=114269
Is this because of the repeated 114269?
Thank you!
Sorry - another heapsort problem... I would really appreciate any suggestions. I am trying to sort an array of 80,000 integers and heapsort almost works except in a 3 or 4 places. I have shortened the array now to:
ra[0]=13697;
ra[1]=114269;
ra[2]=114269;
ra[3]=98514;
ra[4]=114167;
ra[5]=105169;
ra[6]=112051;
ra[7]=102445;
ra[8]=102965;
ra[9]=105585;
ra[10]=106043;
ra[11]=16995;
ra[12]=113773;
ra[13]=113863;
ra[14]=100632;
ra[15]=52743;
ra[16]=52723;
and hpsort from NRinC sorts it to
ra[0]=13697
ra[1]=1.02295e-43
ra[2]=16995
ra[3]=52723
ra[4]=52743
ra[5]=98514
ra[6]=100632
ra[7]=102445
ra[8]=102965
ra[9]=105169
ra[10]=105585
ra[11]=106043
ra[12]=112051
ra[13]=113773
ra[14]=113863
ra[15]=114167
ra[16]=114269
Is this because of the repeated 114269?
Thank you!