Initial C version. Adjusted size and iteration count in Java version for performance comparison.