I am thinking about a non-comparison sorting algorithm and I think I've found one myself.
Input: A[0...n] ranged from 0...n //ideally, I think it can be expanded to more general case later
Non-comparison-sort(A,n):
let B = [0...n] = [0]
for i in A:
B[A[i]]=i
After this algorithm,each element in array B will have a reference to array A and say if we want to access A[k] whose value is m, we can use A[B[m]]
I am sure I am not the first one come across this idea, So my question is what is this algorithm called?
Thanks in advance.