Address Calculation Sort in C