I have an interesting thought-problem right now, so maybe some of you could help.
Basically, I have an array of bytes and I need to know the order of each individual element in this array - by value. Oh man, I’ll just show you a small example, I think this will help better:
byte[] array = new byte[4] { 42, 5, 17, 39 }
I want to get this as a result
4 1 2 3
What would be a smart way to do this?
In addition, I would like the algorithm to keep order if the values are evaluated equal. So
new byte[4] { 22, 33, 33, 11 }
should lead to
2 3 4 1
source
share