I have been given some algorithms to reverse engineer. The algorithm below is a radix sort, but I am very confused about what is actually happening in the code.
I\'
Algorithms are where you should start learning about programming!
To see what an undocumented piece of code does, you may need to adopt a pseudo-language to put the work into an english mathematics statement.
For example, you note that this snippet should only work for 8-bit numbers (the outer loop on bit). The rough description is that the array elements are "sorted" into two buckets depending on whether the bit in position "bit" is a zero or a one -- starting with the bit in the lease significant position. The original array is then reordered with "ones" coming before "zeros" .. which should order the array from largest to smallest.
You would be well served to look up radix sort algorithms, and start with that rather than starting with code.