Hi, i need to sort an array of elements according to certain mapping i get as input.
for example if my array is : A B C D E
and the mapping table is : 1 2 5 4 3
then the result will be : A B E D C
atomic operation : swap(a,b) - also uses 1 memory space a temporal storing place.
i need a method the perform the above function in minimal memory consumption, minimal number of atomic operations, and maximal efficiency.
any suggestions are welcomed !
thanks,
for example if my array is : A B C D E
and the mapping table is : 1 2 5 4 3
then the result will be : A B E D C
atomic operation : swap(a,b) - also uses 1 memory space a temporal storing place.
i need a method the perform the above function in minimal memory consumption, minimal number of atomic operations, and maximal efficiency.
any suggestions are welcomed !
thanks,
Comment