// output of ./demo/sort/sortptr-demo.cc: // Description: //% Demo of pointer-sorting. arg 1: 25 == n [Number of elements] default=25 random values: 0: 0.84019 x[0]=^=0 1: 0.39438 x[1]=^=1 2: 0.7831 x[2]=^=2 3: 0.79844 x[3]=^=3 4: 0.91165 x[4]=^=4 5: 0.19755 x[5]=^=5 6: 0.33522 x[6]=^=6 7: 0.76823 x[7]=^=7 8: 0.27777 x[8]=^=8 9: 0.55397 x[9]=^=9 10: 0.4774 x[10]=^=10 11: 0.62887 x[11]=^=11 12: 0.36478 x[12]=^=12 13: 0.5134 x[13]=^=13 14: 0.95223 x[14]=^=14 15: 0.9162 x[15]=^=15 16: 0.63571 x[16]=^=16 17: 0.7173 x[17]=^=17 18: 0.1416 x[18]=^=18 19: 0.60697 x[19]=^=19 20: 0.016301 x[20]=^=20 21: 0.24289 x[21]=^=21 22: 0.13723 x[22]=^=22 23: 0.80418 x[23]=^=23 24: 0.15668 x[24]=^=24 sorted values: 0: 0.016301 x[0]=^=20 1: 0.13723 x[1]=^=22 2: 0.1416 x[2]=^=18 3: 0.15668 x[3]=^=24 4: 0.19755 x[4]=^=5 5: 0.24289 x[5]=^=21 6: 0.27777 x[6]=^=8 7: 0.33522 x[7]=^=6 8: 0.36478 x[8]=^=12 9: 0.39438 x[9]=^=1 10: 0.4774 x[10]=^=10 11: 0.5134 x[11]=^=13 12: 0.55397 x[12]=^=9 13: 0.60697 x[13]=^=19 14: 0.62887 x[14]=^=11 15: 0.63571 x[15]=^=16 16: 0.7173 x[16]=^=17 17: 0.76823 x[17]=^=7 18: 0.7831 x[18]=^=2 19: 0.79844 x[19]=^=3 20: 0.80418 x[20]=^=23 21: 0.84019 x[21]=^=0 22: 0.91165 x[22]=^=4 23: 0.9162 x[23]=^=15 24: 0.95223 x[24]=^=14 searching for v=0.36478 found at (ptr-)index 12 == x[8]