JJ,
> I guess I was too fixed on doing everything in place (swapping records)
Thinking a bot more about your solution I realized that my swapping idea
would still work, as it constitutes to "bubbeling" the first record to the
right, moving all other records to the left :
legenda:
x(y,z)
x - DPA index
y - current record index
z - desired record index
'<>' swap action
'..' completed swap action
0(0,7) <> 7(7,1) <> 1(1,0)
0(7,7) .. 7(0,1) <> 1(1,0)
0(7,7) .. 7(1,1) .. 1(0,0)
The problem that I had was that I don't directly see way to also update the
indices stored in the DSA - up until that I realised that I don't need them
after the swapping. Better yet, I can set them to "already swapped"
value, so the next iteration steps see that entries #1 and #7 have already
been processed and must be skipped.
Regards,
Rudy Wieser