You don't need another level of indirection, you need to make your indirection bidirectional. Besides the actual array storing the values, use a hash to look up positions from keys and an array to look up keys from positions. You just need to be careful about updating the bookkeeping structures in the right order.
Makeshifts last the longest.
In reply to Re: Re-orderable keyed access structure?
by Aristotle
in thread Re-orderable keyed access structure?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |